Skip to main content

Advanced Validation

With Advanced Validation you can easily add custom rules to your form fields

Updated over a year ago

In our guide about Advanced Validation you can check how it works and what possibilities it will provide you with. But here we will check some examples for different usecases:

Field should have at least one word and at least one number

Here is our regular expression example: ^(?=.*[0-9])(?=.*[a-zA-Z])[a-zA-Z0-9]+$

In order to make it work we need to add it in our field with enabled Advanced Validation

And here is how it will work on front-end:

P.S. If you will need to allows using spaces - you might need to change expression to this one: ^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[\s])([a-zA-Z0-9\s]+)$

Minimum eight characters, at least one letter, one number and one special character

Example of regular expression:

^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$

Match Hebrew and English characters

Regular expression: ^[a-zA-Z\u0590-\u05FF\u200f\u200e ]+$

All Greek & Latin characters only

Regular expression: ^[A-Za-zΑ-Ωα-ωίϊΐόάέύϋΰήώ ]+$

Allow only numbers

Regex example: ^[0-9]*$

Only Latin characters and numbers

Example: ^[A-Za-z0-9 ]+$

How to prohibit usage not special characters like % ( ) &

You just need to add the necessary special characters separated by a slash

^[^%\(\)\&]+$

Maximum allowed 5 words

Redular expression: ^(?:\b\w+\b[\s\r\n]*){1,5}$

Can't use numbers

Regular expression: (?=.*[0-9])

Be advised, here we need to change Rule Type

First letter should be capital

Regex: ^([A-Z])

Disallow entering "gmail"

Regex: (gmail)

Can't use space

Regular expression: ^\S+$

Can't send mails

Regular expression: (\w+[\w.])@\w+[\w.].\w+

More examples you can always find online. Here are some references:

And to test your expression you can here

Did this answer your question?