Questionnaire - Constraint Examples

Regular expressions

The regular expression examples provided in the wizard verify that the input string contains the pattern.

To make sure the input does not contain other information, add ^ at the begining and $ at the end of the regular expression.

Expected format Examples Corresponding regular expression
European phone number, with or without extra information
  • +(33) (office)
  • +(33) (mobile)
One European phone number, without any other information
  • +(33)
One USA phone number, without any other information
  • +(33)
^(\([0-9]{3}\) |[0-9]{3}-)[0-9]{3}-[0-9]{4}$
One email, without any other information ^.+@[^\.].*\.[a-z]{2,}$
String limited to 15 characters abc123 @ & xyz ^.{1,15}$

Note: It is not advisable to apply this type of constraint on memo questions, where HTML code may be added when the text is formatted. When the constraint is being checked, the whole character string will be considered (the text entered as well as the HTML code).

example   If a user enters A bold text in a memo question, the character string considered is <strong>A bold text</strong> and the size of the string is 28 characters, not 11



Powered by XWiki © EasyVista 2022