Survey Question Field Validation (INTERPODIA ADMIN ONLY)

How to create regular expression field validation for text field survey questions

Text field survey questions allow for field validation through the use of a regular expression. In short, these expressions limit what text in what format can be entered into a survey question text field.

In Django, these can be set up from 'Survey_App > Survey questions'. Selecting or creating a new survey question, the regular expression is entered in the 'Validation' field:

The example above uses a regular expression that limits the text field to contain a MM/DD/YYYY date.

The following tool can be used to create and validate a regular expression to limit a survey question text field to only contain desired text:

In the above screenshot, we can see that it validates the test string as being a 'Full match' when tested against the MM/DD/YYYY date regular expression. The highlighted 'Quick Reference' area will detail the information needed to write a new regular expression. 

When completing a regular expression, please include it in the below list so that it can be re-used in future setups.

Regular Expression List

  • MM/DD/YYYY - either / . or - separating the numbers


  • One digit, one dash, and 7 digits


  • Phone number xxx-xxx-xxxx


  • Email : any string of characters + @ + any string of characters + . + at least 2 letters


  • Only numbers, min 2 no limits