Regular Expressions
Prerequisites: Users require at least one of the following:
Users require moderator+ permissions for the module to complete this task.- If editing an existing survey,
Users require contributor+ permissions for the module and must be the item creator to complete this task. - If creating a survey,
Users require contributor+ permissions for this module to complete the task.
$
, which refers to the end of a string, or “.
”, which
refers to any character) make regular expressions powerful and efficient—they can
describe complex patterns using relatively few characters.By using regular expressions in Cartella’s survey module, customize and add flexibility to surveys. Use regular expressions to ensure that users select a certain answer; to limit a text answer to certain number of characters; or to ensure that a valid email address was entered.
The Regular Expression and RegEx Message fields display for each survey question.
Enter the code for the regular expression in the Regular Expression field, and in the RegEx Message field, enter a message to display if the user’s answer doesn’t match the regular expression. In the example below, the regular expression requires that a text answer be between one and 50 characters.