Important Note: You may require help from your developer to use Regex. 🙍♂️
You can create rules that people have to follow when they fill out your form.
For example, if you ask for EIN, you can make sure that people can only submit properly formatted data - if the format is wrong, they'll see an error message.
In order to accomplish that, you can use Regular expressions (Regex) in your Clustdoc forms.
Adding a Regex
Head over to your Clustdoc form whether it's in a process, a live application or saved in the Toolbox
Scroll to the field where you want to add Regular expressions
Select the Regex type of field
Add the regular expression into the related field
Add a Help Text that will be displayed in Red if the format is Invalid
A few examples
Example of placeholder | Regex to add to form field | |
Social Security Number SSN | 123-45-6789 | ^\d{3}-?\d{2}-?\d{4}$ |
Employer Identification Number EIN | 12-1234567 | ^[1-9]\d?-\d{7}$ |
5 digits Zip Code | 10001 | ^\d{5}$ |
10 digits Phone Number | 5555555555 | ^\d{10}$ |
Last 4 digits SSN | 1234 | ^\d{4}$ |
Regex Cheat Sheet
💡 Easy way to generate a Regex : https://www.autoregex.xyz/
Character | Meaning | Example |
* | Match zero, one or more of the previous |
|
? | Match zero or one of the previous |
|
+ | Match one or more of the previous |
|
\ | Used to escape a special character |
|
. | Wildcard character, matches any character |
|
( ) | Group characters | See example for |
[ ] | Matches a range of characters |
|
| | Matches previous OR next character/group |
|
{ } | Matches a specified number of occurrences of the previous |
|
^ | Beginning of a string. Or within a character range |
|
$ | End of a string. |
|