You can apply advanced validation to check responses against certain “patterns” or “regular expressions” (RegEx) by using the form designer's regex() function, e.g. =regex(string value, string expression). This function returns result of applying the given regex expression to the given value

Regular expressions use a powerful syntax which you can use to build very complex patterns. See the cheat sheet attached to this article for a reference or try RegExr, a free online tool to help you build your own regular expressions.

Some examples of RegEx:

RegEx examples


Successful input


Validates whether the response contains the string "taken".



Validates whether the response starts with the string "taken".

taken over


Validates whether the response matches the string "taken" exactly.



Validates whether the response is exactly 4 digits in length.



Validates whether the response is a 4 to 10 digit number.



Validates whether the response begins with either the letter 'V' or 'B' (upper or lower case) followed by a 6-digit number.



Validates whether the response starts with two digits, a dash, and then six or seven digits; after the 6/7 string of digits there is always a space, then a letter then a space and finally two more digits; not case sensitive).

07-1234567 G 01


Validates whether the response is a South African mobile number (including the optional leading international dialling code). 

Validates whether the input is a valid email
Validates whether the input is a valid company registration number which has a format of 4 digits / 1+ digits / 2 digits.2000/123456/78


Adding validation to a field to ensure the mobile number that is entered is exactly 10 digits long.

  1. Create a new Text field to capture the participant's mobile number. (Note: the Text field type should be used instead of the Number field type for capturing numeric identifiers)
  2. Click on the Validation tab.
  3. Click the 'Configure validation rules' button (if no rules have been set up yet).
  4. Select that the response will only be valid when 'all' of the criteria are met.
  5. Select that the response must be 'equal to' the criteria.
  6. Use the regex function to specify the regular expression rules: The first parameter is a reference to the current field ("$Text_field_3") as the 'value', and the second parameter contains the regular expression to evaluate the value against, in this case "^[0-9]{10}$".
  7. Additional validation criteria can be added as needed below.

Hint: Test your validation rules by using the 'Previewbutton on the far right in your top toolbar.  

Using the legacy form designer? Have a look at the article on advanced validation in the legacy form designer.