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
Kilo Patron
Kilo Patron

Hi @kali ,

 

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

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

SN_Learn
Kilo Patron
Kilo Patron

Try the below:

 

Validate alpha numeric. 

Alphanumeric RegEx || Prevent two consecutive characters 

Field validation: Regular Expressions 

 

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Community Alums
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.