Topic
If there is a requirement to enforce formatting or prevent special characters in a form control, leveraging Regular Expression may be the most efficient option.
Instructions
- Select the control.
- Open “Control settings”.
- Go to the "Validation" group.
- Set "Use Regular Expression" to 'Yes'.
- Enter the desired expression
Prevent Special Characters (Allow alphanumeric characters only)
w+
Email Address Format:
^tA-Za-z0-9]((-_.-]?(a-zA-Z0-9]+)*)@(9A-Za-z0-9]+)((0.-]?)a-zA-Z0-9]+)*).(9A-Za-z]{2,})$
Additional Information
Configuring validation within the control settings is the only way to leverage Regular Expression for validation at runtime in a Nintex Form. Using a Validation Rule with runtime functions will not properly evaluate Regular Expression. For example, using the contains() function to attempt to prevent special characters only evaluates literal strings rather than Regular Expressions.
Related Links
Microsoft - Regular Expression Language - Quick Reference
Regular Expression Language - Quick Reference
Regular Expression Language - Quick Reference