You are viewing limited content. For full access, please sign in.

Question

Question

Field Validation:

asked on January 25, 2018

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?

0 0

Answer

SELECTED ANSWER
replied on February 1, 2018

[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.

2 0

Replies

replied on January 25, 2018

[a-zA-z]* should do the trick. 

1 0
replied on January 25, 2018

Preicate it Tri Pham.

0 0
replied on February 1, 2018

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.

0 0
SELECTED ANSWER
replied on February 1, 2018

[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.

2 0
replied on February 2, 2018

Greatly appreciate the informative Tri.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.