Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Regex

kali
Tera Contributor

Hi All,

I am using regex to get a alphanumeric value from a string . The regex i  used is [A-Za-z0-9] . Please help me on this .

Thanks in advance.

15 REPLIES 15

SN_Learn
Mega Patron

Hi @kali ,

 

Do you want to validate a string is alphanumeric or not, Is that right?

SN_Learn
Mega Patron

Not applicable

Hi @kali ,

var rg = new RegExp("^[a-zA-Z0-9]");

 

Hi @Community Alums ,

In background script i run the below code 

var subject ="This is a sample case for 123AZBzxc";
var rg = new RegExp("^[a-zA-Z0-9]");
rg.match(subject);
gs.print(rg); After  running the script i am not getting this value 123AZBzxc. Please help me on this.