Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Validation regex for catalog variable

Sancley
Tera Contributor

I need to create a validation Regex in the service catalog variable that only allows letters and the symbol - ,

I tried several possibilities without success.

teste.png

I appreciate any help.

2 ACCEPTED SOLUTIONS

Brad Bowman
Kilo Patron
Kilo Patron

Try [a-z\-]+ with the Case Insensitive flag

BradBowman_0-1674075343905.png

 

View solution in original post

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

This one will match only ASCII letters and the dash symbol:

/[A-Za-z-]/g

If you need to include any special characters, just add them to the character-set.

View solution in original post

4 REPLIES 4

Brad Bowman
Kilo Patron
Kilo Patron

Try [a-z\-]+ with the Case Insensitive flag

BradBowman_0-1674075343905.png

 

Brad, thanks for the valuable help!

Laszlo Balla
ServiceNow Employee
ServiceNow Employee

This one will match only ASCII letters and the dash symbol:

/[A-Za-z-]/g

If you need to include any special characters, just add them to the character-set.

Laszlo, thanks for the valuable help!