Set up validation for fillable fields in your web forms to ensure correct data entry. Choose a validation format from the dropdown menu or use JavaScript regular expressions for custom validation.
Use case example: A recipient needs to fill out a car registration renewal form and specify the car's registration class (consisting of only three digits). This type of car registration class validation is not included in the list of available validation formats and must be set up via a JavaScript regular expression.
1. After adding the single-line field, go to the field properties panel. In the Validation section, select the Customvalidation format.
2. Enter the JavaScript regular expression.
Here, we use the following regular expression: ^[A-Z]{3}, where A-Z means that a recipient should enter capital letters, and 3 refers to the maximum number of capital letters.
Tip: Ensure not to include slashes at the beginning or end of the regular expression to avoid duplication (added automatically by the system).
Also, describe the expected values for the single-line field.
If a recipient enters data in another format than what you've specified, the field will be instantly highlighted and the recipient will be informed that the data was entered in the wrong format.
For more details on building JavaScript regular expressions, refer to the tables below:
^abc$ | start/end of the string |
[abc] | any of a, b, or c |
[^abc] | not a, b, or c |
[a-g] | the character between a and g |
a* a+ a? | 0 or more, 1 or more, 0 or 1 |
a{5} a{2,} | exactly five, two or more |
a{1,3} | a{1,3} |
a+? a{2,}? | a+? a{2,}? |
ab|cd | match ab or cd |
\w \d \s | word, digit, whitespace |
Special sequences
\A | Matches if the specified characters are at the start of a string. |
\b | Matches if the specified characters are at the beginning or end of a word. |
\B | Opposite of \b. Matches if the specified characters are not at the beginning or end of a word. |
\d | Matches any decimal digit. Equivalent to [0-9] |
\D | Matches any non-decimal digit. Equivalent to [^0-9] |
\s | Matches where a string contains any whitespace character. Equivalent to [ \t\n\r\f\v] |
\S | Matches where a string contains any non-whitespace character. Equivalent to [^ \t\n\r\f\v] |
\w | Matches any alphanumeric character (digits and alphabets). Equivalent to [a-zA-Z0-9_]. By the way, underscore _ is also considered an alphanumeric character. |
\W | Matches any non-alphanumeric character. Equivalent to [^a-zA-Z0-9_] |
\Z | Matches if the specified characters are at the end of a string. |
Digits
^\d+$ | Whole numbers |
^\d*\.\d+$ | Decimal numbers |
^\d*(\.\d+)?$ | Whole and decimal numbers |
^-?\d*(\.\d+)?$ | Negative, positive whole, and decimal numbers |
[-]?[0-9]+[,.]?[0-9]*([\/][0-9]+[,.]?[0-9]*)* | Whole, decimal, and fractions |
Alphanumeric characters
^[a-zA-Z0-9]*$ | Alphanumeric without space |
^[a-zA-Z0-9 ]*$ | Alphanumeric with space |



