Format

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
  • email
  • 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
Abcde
abcde

Examples that fail validation

ABCD4
4abc
ab cde
ab*


 


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
ABCDE
abc-d'e

Examples that fail validation

abc12
abc_de
abc de




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
abc de
ab'c'd'e

Examples that fail validation

abcd*
abcd4
12345




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
12345
abc45

Examples that fail validation

Abc**
Abc de
&bcde

 


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
abc de
abc123
12345
abc_de

Examples that fail validation

abcd*
abcd-
a
123.45
-12345




email

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
karim.nafir@mail.com
karim.nafir@mail.example.org

Examples that fail validation

karim.nafir
karim.nafir@mail

 


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
12345
abc45
àbcdé

Examples that fail validation

abc de
abc-de
12345
abcde!




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
1234a
123.45

 


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
12.34
.1234
-1234
-12.34
-.1234

Examples that fail validation

12/345
12 345
1234a
1234%




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
(123).456.7890
(123) 456 7890
123-456-7890
123.456.7890
123 456 7890

Examples that fail validation

456-7890
123/456/7890
(123)-(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
1 123 456 7890
1(123)-456-7890
1.123.456.7890
123-456-7890

Examples that fail validation

456-7890
(1)-123-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
1234A
12 345
.12345
abcde


 


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
12345-6789

Examples that fail validation

1234
123456
12345-67
abcde






The format validation can be used with the following field types:

  • dateselect
  • email
  • password
  • text
  • textarea