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 »
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]+$”