Enalyzer Help Center

What is a regular expression?

A regular expression is a sequence of characters which is used to validate specific string formats in user input. Therefore, regular expressions are generally used to ensure the data collected is formatted properly.

Enalyzer has preloaded regular expressions that allow you to validate numbers, emails, and texts. Nevertheless, you can insert your own regular expressions.

How do I use regular expressions for validation in Enalyzer?

Example: You want to collect zip codes and it is crucial these are valid US zip codes.

  1. Create an input field question and under format, choose custom. Now you have two fields:
    • Example text: Insert an example that matches your regular expression. In this case, it could be 94101, which is a San Francisco zip code.
    • Enter regular expression for validation: Insert a regular expression. In this case, the regular expression is ^\d{5}(-\d{4})?$.
  2. Finally, click add. If you experience an error, its because your example text does not match your regular expression.

Useful regular expression patterns
If the RegEx pattern you are looking for is not available in the above list, here are a few additional RegEx patterns that are helpful.

  • Match only email addresses from Gmail: [^ ]*@gmail\.com$
  • Match only letters, numbers and spaces and NOT special characters: ^[a-zA-Z0-9 ]+$
  • Time in 24 hour format: ^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$
  • Match only postcodes in The Netherlands: ^\d{4}\s?\w{2}$

Helpful resources

To browse through commonly used regular expression patterns, check out this website: RegExLib.

If you want to create your own, here is a cheat sheet and here you can test your own regular expressions.

Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk