Allow only Alphanumeric values and special characters _ - @

krishna87654
Kilo Expert

Catalog variable "username" should allow alphabets, numbers and special characters only _ - @ 

 

3 REPLIES 3

Pranav Bhagat
Kilo Sage

You can use this regex /^[ A-Za-z0-9_@./#&+-]*$/.

 

To know more about regex ,watch this videos.

https://community.servicenow.com/community?id=community_question&sys_id=93860b25db1cdbc01dcaf3231f9619f0

Regards

Pranav

 

 

Hi

Hope you are doing good.

Is this question resolved or you need some more assistance?

if your query is resolved then please mark the correct response so that this thread can be closed.

Regards

Pranav

asifnoor
Kilo Patron

Hello Krishna,

you can create a regex on your variable in Servicenow without any script. Check this out

https://docs.servicenow.com/bundle/orlando-it-service-management/page/product/service-catalog-manage...

And for the regex, you can say it like this

^[ A-Za-z0-9_@-]*$

Refhttps://regex101.com/

Mark the comment as a correct answer and helpful if it helps to solve the problem.