Uses regular expressions to verify that the field value meets the required format. For example, if the format is set to alpha, then only alphabetic characters (a-z and/or A-Z) are allowed. A value such as abcd (all alphabetic characters) will pass validation; a value such as ab-cd (hyphen) or abc7 (number) will not.
To configure this validation, click Format Required and then select the appropriate format type:
Available format types are:
- alpha
- alphaExtended
- alphaExtendedSpaces
- alphaNumeric
- alphaNumericExtended
- i18nAlphaNumeric
- numeric
- numericReal
- phone
- phoneInternational
- zipCode
- zipCode+4
These format types are described in the following sections of the documentation.
alpha
To pass validation, the value must contain at least one alphabetic character (A-Z and/or a-z). Empty strings or strings containing any non-alphabetic characters (including numbers) will fail validation.
Regular expression (Python): ^[a-z]+$
Examples that pass validation | ABCDE |
Examples that fail validation | ABCD4 |
alphaExtended
To pass validation, a value must contain at least one alphabetic character, dash (-), and/or single quote ('). Empty strings, or strings that contain non-alphabetic characters (including numbers or blank spaces) will fail validation.
Regular expression (Python): ^[a-zA-Z\-']+$
Examples that pass validation | abcde |
Examples that fail validation | abc12 |
alphaExtendedSpaces
To pass validation, a value can contain only alphabetic characters, dashes (-), single quotes ('), and/or the following whitespace characters:
- Carriage return (\r)
- Newline (\n)
- Tab (\t)
- Form feed/page break (\f)
Regular expression (Python): ^[a-zA-Z\-'\s]+$
Examples that pass validation | abcde |
Examples that fail validation | abcd* |
alphaNumeric
To pass validation, a value must contain at least one alphabetic or numeric character. Empty strings, or any strings containing a non-alphanumeric character, will fail validation.
Regular expression (Python): ^[a-z0-9]+$
Examples that pass validation | abcde |
Examples that fail validation | Abc** |
alphaNumericExtended
To pass validation, a value must contain at least two alphanumeric characters.
In addition to alphabetic and numeric characters, dashes (-), underscores (_), and periods (.) can be used as long as these characters don’t appear at the beginning or the end of the string.
Regular expression (Python): ^[a-z][-a-z0-9\s_.]*[a-z0-9]$
Examples that pass validation | abcde |
Examples that fail validation | abcd* |
To pass validation, a value must contain an email address that uses the following format:
name@domain.top-level-domain
For example, karim.nafir@mail.com passes the validation test; karim.nafir@mail does not.
Note that this validation only checks the formatting of the string; it does not attempt to determine whether the supplied email address is a real email address.
Regular expression (Python): ^.+@(?:[^.]+\.)+(?:[^.]{2,})$
Examples that pass validation | karimnafir@mail.com |
Examples that fail validation | karim.nafir |
i18nAlphaNumeric
To pass validation, a value must contain only alphanumeric characters (including alphabetic characters, such as é, that include an accent). Any other character, including numeric characters or blank spaces, results in a validation failure.
Regular expression (Python): ^[^-\s^`~!@#$%^&*()_=+\[{\]}\|;:‘“,<.>/?]+$
Examples that pass validation | abcde |
Examples that fail validation | abc de |
numeric
To pass validation, a value can only contain numbers. A string with any non-numeric characters will fail validation.
Regular expression (Python): ^(\d+)$
Examples that pass validation | 12345 |
Examples that fail validation | abcde |
numericReal
To pass validation, a value can contain only real numbers; this includes negative numbers and decimal values.
Regular expression (Python): ^(\d+\.?\d*|\.\d+|\-\d+\.?\d*|\-\.\d+)$
Examples that pass validation | 1234 |
Examples that fail validation | 12/345 |
phone
To pass validation, a value must be formatted as a phone number, including area code. Certain characters – such as dashes, parentheses, and periods – can be used as long as they are used in a standard phone number format. For example, (123)-456-789, with the parentheses around the area code, is allowed; 123-(456)-7890 is not. Note that country codes are not allowed either. If you need to use country codes (e.g., 1-123-456-7890) then use the phoneInternational format.
Regular expression (Python): ^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$
Examples that pass validation | (123)-456-7890 |
Examples that fail validation | 456-7890 |
phoneInternational
To pass validation, a value must be formatted as a phone number, including area code. Certain characters – such as dashes, parentheses, and periods – can be used as long as they are employed in a standard phone number format. For example, (123)-456-789, with the parentheses around the area code, is allowed; 123-(456)-7890 is not. That's because parentheses are usually not found in that location when specifying a phone number.
In addition, and unlike the phone format, you can also include an optional country code: 1-123-456-7890.
Regular expression (Python): ^(\d{1,4}[-. ]?)?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$
Examples that pass validation | 1-123-456-7890 |
Examples that fail validation | 456-7890 |
zipCode
To pass validation, a value must contain exactly 5 numeric characters. Any value with a non-numeric character, or with any number of characters other than 5, will fail validation.
Regular expression (Python): ^\d{5}$
Examples that pass validation | 12345 |
Examples that fail validation | 1234 |
zipCode+4
To pass validation, a value must be formatted as a standard 5-character zip code (e.g., 97206) or as a 10-character “zip plus 4” zip code (e.g., 97206-5555). Any other format or any non-numeric character other than a dash (which must be the sixth character in the value) will result in a validation failure.
Regular expression (Python): ^\d{5}(\-\d{4})?$
Examples that pass validation | 12345 |
Examples that fail validation | 1234 |
The format validation can be used with the following field types:
- dateselect
- password
- text
- textarea