Regex Expressions will allow you to restrict the users to input any value that you don't want them to input.
With our extension you can apply your own regex patterns to any Elementor Pro Form field.
How to create and test Regex
We suggest using regex101.com to build and test your regex.
Follow these steps:
Select ECMAScript as the flavor on the left panel.
On the right side of the regex, you will see the flags after the slash
/
.Remove all flags and keep only the
v
flag.
In our plugin, you must use only the body of the regex, without the slashes
/
or the flags.
Example:
On regex101.com:
/^[0-9]{5}$/v
In our plugin:
^[0-9]{5}$
Examples
Here are some common examples you can use:
Only numbers (5 digits, like ZIP codes):
^[0-9]{5}$
Only letters (no numbers, no symbols):
^[A-Za-z]+$
Phone number with country code (+39 for Italy):
^\+39\d{9,10}$
Simple email validation:
^[^\s@]+@[^\s@]+\.[^\s@]+$
No spaces allowed:
^\S+$