Using the Regular Expression for Validation in a Field's Advanced tab, is there a way to only require alpha characters in the field - no numeric or special characters?
Question
Question
Answer
[a-zA-Z- ()]*
and
[a-zA-Z0-9]*
I'll recommend https://regex101.com/ to you so you can play around with regular expressions. The brackets "[" and "]" make a character class that includes whatever characters you list in it (a-z, A-Z, and 0-9, for instance). The asterisk "*" means 0 or greater characters of that class, which will make the validation check the entire string of whatever is typed out.
Replies
[a-zA-z]* should do the trick.
Tri Pham,
In the Product Name field, I would like to only allow alpha and special characters like parenthesis (), space [space], and dash -
In the Dosage/Package Size field, I would like to only allow numeric and alpha
Would you help me understand the Expression for Validation codes? Preciate your assistance thus far.
[a-zA-Z- ()]*
and
[a-zA-Z0-9]*
I'll recommend https://regex101.com/ to you so you can play around with regular expressions. The brackets "[" and "]" make a character class that includes whatever characters you list in it (a-z, A-Z, and 0-9, for instance). The asterisk "*" means 0 or greater characters of that class, which will make the validation check the entire string of whatever is typed out.
Greatly appreciate the informative Tri.