regular expression for email

2
Hi, I want user to enter the email address only in my field. How can I acheive this? What regular expression would be required to do so. And If I want to restrict the user to enter specific format of string only, how that can be done? Please help me. Thanks & Regards, Rajnish Kumar
asked
2 answers
1

You could use the input mask property of a text box. But this one is limited if you compare it with regular expressions. If you want to use regular expressions, create a before commit microflow for your validations and use isMatch to validate with regular expressions.

By the way, a simple Google search will help you to validate your email with regex :)

answered
1

A regular expression for email that won't match all valid email address but does match most of them is:

\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,6})+

To actually match ALL valid email addresses would lead to a regular expression of a few pages long. This is not something that is easily done in regular expressions.

Simply add a regular expression (right click your module, click add regular expression) and then you can use it in entity validation, open an entity from your domain model, go to the validation rules tab, add a new rule and use a regular expression. Or you can use isMatch like Samet Kaya linked.

answered