Skip to main content
Nintex Community Menu Bar
Solved

Excluding characters in regular expression


Hello. I need use a Text-short item in NWC form and i need to avoid the user to use nontypical characters (like symbols like &#@ or accented letters like řžŘÝ). So i want to use Input validation atribut with Regular expression, but i have no clue how the pattern should look like. How to exclude those chars and force to use only latin alphabet lowercase/upercase and numbers? 

Best answer by bsikes

It may be easiest to specify what characters are acceptable instead of which are not. Not sure on the Latin alphabet part, but this works for the English alphabet:


^([a-z]|[A-Z]|[0-9])*$


 


^ = beginning of string


() = group (an "or" group in this case, separated by | characters)


[] = range of specified characters ([ac] would mean a or c, while [a-c] would mean a, b, or c)


* = match 0 or more characters of what was just specified (in this case, groups of acceptable characters)


$ = End of string


 


Put all together, it's verifying that between the start and end of the string, the only characters present are lowercase a-z, uppercase A-Z, or number 0-9. 

View original
Translate
Did this topic help you find an answer to your question?

2 replies

Forum|alt.badge.img+10
  • Scout
  • 129 replies
  • Answer
  • April 5, 2022

It may be easiest to specify what characters are acceptable instead of which are not. Not sure on the Latin alphabet part, but this works for the English alphabet:


^([a-z]|[A-Z]|[0-9])*$


 


^ = beginning of string


() = group (an "or" group in this case, separated by | characters)


[] = range of specified characters ([ac] would mean a or c, while [a-c] would mean a, b, or c)


* = match 0 or more characters of what was just specified (in this case, groups of acceptable characters)


$ = End of string


 


Put all together, it's verifying that between the start and end of the string, the only characters present are lowercase a-z, uppercase A-Z, or number 0-9. 

Translate

Thanks, it helped and works!

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings