Using Regular Expressions in Cartella Survey Questions
Learn how to use regular expressions in survey questions in Cartella. Users can add response restrictions to Cartella survey questions by implementing regular expressions.
Description
Users can add response restrictions to Cartella survey questions by implementing regular expressions.
Reasons to use regular expressions include:
- Limit Characters. Survey participants may enter extensive responses to open-ended questions. If survey creators prefer shorter responses, they can apply a regular expression to limit the number of characters that participants enter.
- Set Number Length. Survey creators can specify a number length for survey participants to enter. For example, a regular expression that limits number length may benefit questions about age, zip codes, etc.
- Prohibit Special Characters. Survey creators can apply a regular expression to prevent participants from entering special characters.
Requirements
Users require at least one of the following:
Users must have moderator+ permissions for the module to complete this task.- If editing an existing survey, u
sers must have contributor+ permissions for the module and must be the item creator to complete this task. - If creating a survey,
users must have contributor+ permissions for this module to complete the task.
Step-by-Step
To add a regular expression to a survey question:
- Navigate to a Survey module.
- Click Create Survey or edit an existing survey.
- Scroll to the Survey Steps area, and click Add to create a survey step.
- Select the survey step in the Steps field.
- Click Add Question.
-
Enter an expression in the Regular Expression field.
Choose an expression that suits your survey needs.
Regular expression examples include:
- ^.{1,200}$
Use this expression to only accept responses that contain 1-200 characters (spaces included).
- ^\d{3}$
Use this expression to only accept responses that contain a three-digit number.
- ^[^!@#$%^&*()_]+$
Use this expression to only accept responses that don’t contain special characters.
- ^.{1,200}$
-
Optional: If applicable, enter a RegEx Message that displays to participants when the survey doesn’t validate a response entry.
The message clarifies why the survey refused the entry.
Additional Information
- See Creating Surveys for Cartella survey creation details.
- See Regular Expressions for Cartella Survey RegEx details.
- See Microsoft: Regular Expression Language – Quick Reference for details.
There are no comments yet.