Have Questions? (800) 609-6480

RegEx Validation

What is this?

You can use regular expressions in your survey logic to determine what to do next. For example, on a textbox entry you could check to see if they entered several words. Let’s say we have a question and a response like:

Q1: What is your favorite band?
A1: The Postal Service

You could then create page logic on the answer using Regular Expressions. Say you want to ask them a further question like “Did you know that you’re awesome?” on page 2 if they answered The Postal Serivce, Postal Service or Death Cab for Cutie. You’d set up a logic condition like so:

If the answer to “What is your favorite band?” does not match regex pattern: “Postal Service|Death Cab for Cutie” then jump to Survey Page #3 (the thank you page) otherwise go to Page #2 (the awesome question).

You can use any standard regular expression in your syntax. Here are some other quick examples:

– Match only email addresses from gmail: “[^ ]*@gmail\.com$”
– Match only serial numbers with 4 numbers, dash, 4 numbers: “^[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]$”
– Match only first names that start with R or r and have a last name: “^[Rr][^ ] [a-zA-Z]+$”
– Match the numbers 30, 31 or 32: “^30$|^31$|^32$”
– Match any dates in July in the format MM/DD/YYYY: “^07/[0-9][0-9]/[0-9][0-9][0-9][0-9]$”
– Match only pure alpha strings: “^[a-zA-Z]+$”

Start your free 14 day trial

Get all features for $50/month. Add users for $20/month each.

Questions? Call us anytime during your trial at (800) 609-6480 ext 1.

No credit card required.

  • (800) 609-6480 ext 1
    for help setting up larger teams.

* Extra users are free for the duration of your trial.
You can change the number before upgrading to a paid plan.

Best of SurveyGizmo Weekly

By . In Know How.

Likert Scale – What is it? When to Use it? How to Analyze it?

April 24 2012 -

In all likelihood, you have used a Likert scale (or something you’ve called a Likert scale) in a survey before. It might surprise you to learn that Likert scales are a very specific format and what you have been calling Likert may not be. Not to worry — researchers that have been doing surveys for… Read More »

By . In Interviews.

How One Company Beat All Odds in Conducting An Offline Survey In Africa

World-Wize Surveys used the SurveyGizmo API to build their own iPad survey app. Want to know how? Read on.

By . In Best Practices.

How to Get A Raise By Creating Surveys You Can Act On

The most successful survey creators know that creating a survey starts with a solid plan, before you even begin building your survey.

More from our Survey Experts