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
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
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
Match Hebrew and English characters
Regular expression: ^[a-zA-Z\u0590-\u05FF\u200f\u200e ]+$
All Greek & Latin characters only
All Greek & Latin characters only
Regular expression: ^[A-Za-zΑ-Ωα-ωίϊΐόάέύϋΰήώ ]+$
Allow only numbers
Allow only numbers
Regex example: ^[0-9]*$
Only Latin characters and numbers
Only Latin characters and numbers
Example: ^[A-Za-z0-9 ]+$
Maximum allowed 5 words
Maximum allowed 5 words
Redular expression: ^(?:\b\w+\b[\s\r\n]*){1,5}$
First letter should be capital
First letter should be capital
Regex: ^([A-Z])
Disallow entering "gmail"
Disallow entering "gmail"
Regex: (gmail)
Can't use space
Can't use space
Regular expression: ^\S+$
More examples you can always find online. Here are some references:
And to test your expression you can here