The ReGex pattern allows us to implement Validation into your Text Field. Validation allows you to restrict what data is put into your Text box. For instance, we can restrict the user to characters ranging from A to H or to lowercase characters exclusively etc.
Presets and Validator
At the end of the entry box, you will see a button that allows you to open up more options to edit the pattern. You will the below screen that allows you to select a variety of preset options that will fill in the regex box, this can then also be added to if you want additional validation on the preset. If you are would like to make sure that the validation works without having to publish there is a test option that tells you if what you entered is valid.
Some Common Examples:
Alphanumeric without Spaces
/^[a-zA-Z0-9]*$/
Whole Numbers
/^\d+$/
UpperCase Letters with white space
[A-Z\s]+
LowerCase Letters with white space
[a-z\s]+
Colour HexCode
Colour Hexcode "^#(?:[0-9a-fA-F]{3}){1,2}$
For a more detailed explanation of Regex a suggested article is:
https://www.regular-expressions.info/quickstart.html
Use Case Examples
Match Any Email Address from a Specific Domain | |
Usage Example | Match any email address from the domains hotmail.com, and gmail.com. |
Regex | (\W|^)[\w.\-]{0,25}@(hotmail|gmail)\.com(\W|$) |
Notes |
|
Match Word or Phrase |
|
Usage Example | Match any word or phrase in the following list:
|
Regex | (?i)(\W|^)(Softools|Gridfields|Zero\sCode)(\W|$) |
Notes |
|
Comments
0 comments
Please sign in to leave a comment.