RegexPro
An input field that is validated based on the specified regex pattern (e.g. /^[a-zA-Z0-9]*$/). The field.type property value is regex (for conditionals).
Settings
- Specify a required pattern for values to match, e.g.
/^[a-zA-Z0-9]*$/.- When needing to use
{}for attributes in Regex fields (such aspattern), you will need to specify them differently, as Freeform is built to allow Twig rendering and it'll choke. So for example, if you need to use[0-9]{4,5}, change it to:[0-9]{{ '{' }}4,5{{ '}' }}
- When needing to use
- Set the error message a user will see if an incorrect value is supplied.
- Any occurrences of
{pattern}will be replaced with specified regex pattern inside the error message, if any are found.
- Any occurrences of
Templating
| Property | Description |
|---|---|
field.pattern | The translated regular expression used to validate the value. |
field.message | The translated validation error message. |