Validation & Regex in screeners

Sometimes in a screener, you want to be able to control what can be added to a field. For example, if you are trying to capture a phone number from a respondent, you would use the Number Input. But how do you confirm that what the respondent is entering matches a typical phone number?


In Panelfox, there is an option to add "Answer validation" to the Number Input and Short Answer question types. This allows you the ability to restrict what can be submitted. Additionally, you can add Custom error text to the question, letting the respondent know why their answer wasn't accepted.


Panelfox currently has two types of validation, Email and Regex.

Email

When selecting Email, any Email address entered into the field would have to minimally match the following: a@b.co. This means that email address like test@panelfox.io would be accepted, but test.panelfox.io would not (since it does not contain an @).


Regex

If you have more advanced needs, you can select Regex. When selecting Regex, you add your own Regular Expression that all respondent answers will have to match. For example, if you are adding a Regex for a phone number, it might look like this:


^[2-9]\d{2}-\d{3}-\d{4}$


This Regex would accept a number like '800-555-5555', but would reject a number like '000-000-0000' or '2126661234'.


For further examples of how to build a regex that suites your needs, https://regexlib.com/Default.aspx is a great resource.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us