Skip to main content
Skip table of contents

Regular Expressions

Regular expressions are patterns used to match character combinations in strings and are used to make your respondents entering their answers in strict format that meets your needs.

For example, you can create a custom format for the entered text to match the certain formatting of the date or the phone number, the zip code or the email address. You can also define the specific range for the number that you would like to be entered as a response, etc.

This advanced feature allows you to use regular expressions when you need to create new formats for Single-Line and Matrix types of questions and complex report filtering.

Regular expressions are usually used to give a concise generalized description of a set of elements, without having to list all of them. A regular expression pattern can be composed of simple characters, such as abc, or a combination of simple and special characters, such as ab*c or Chapter (\d+)\.\d*.

Simple patterns are constructed of characters for which you want to find a direct match. When the search for a match requires something more than a direct match, such as finding one or more occurrences of a certain character, or finding white space, the pattern includes special characters.

How to use regular expressions

To use regular expressions for creating new question formats customize Matrix scale or format answers for Single Line Text type of question.

  • Click New Format button.

  • Select Text from the Select content type drop-down box.

  • Enter a name for your format in the Format name text box.

  • Enter regular expressions in the Input a regular expression for pre-checking contents box.

  • Type the text in the Type value for test box to check up your regular expressions and click the Test button.

  • Click Save to save new format.

To see the list of available regular expressions read the List of Regular Expressions help chapter.

  • Please note that the character limit for a regular expression is 1024 symbols.

  • If you want to make a regular expression case insensitive, you may add  a modifier (?i) to your expression. For example, Show Q2 if Q1.A1==RLIKE(?i)(north|south).

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.