Regex expression validation is not working

snow57
Tera Contributor

Hi, 

 

The regex validation in the below code is not working. could someone please help me on this .

 

 

var nonPrint = "123Test*input";
gs.print('nonPrint1'+nonPrint);
var regex =/^[0-9][0-9]*$/;
var s = nonPrint.replace(regex, '_');
gs.print('nonPrint2' + s);

 

Appreciate for the leads.

 

Thanks