Regular Expression for Email format

0
Hi,  I’m recently working on Module 8 of the Rapid developer session. I found that the regular expression for email format checks does not work well. I also tried other expressions from different sources. Neither works. Please let me know if this is because of my design issue.    Thanks, Yuqi
asked
6 answers
2

This library has always been a help to me: https://regexlib.com/

If you use this for a validation rule at entity level it should work.

If not, please provide more information what you experience and what you define as Not working

answered
2

In addition to Rene’s answer, there is also a regular expression for email validation in the Community Commons module in the Marketplace that may be of use here.

https://docs.mendix.com/appstore/modules/community-commons-function-library/#48-regexes

answered
1

Here are some screenshots. 

 

 

 

answered
1

Hi YUQI, Well, your use of the regex is correct. Very, very likely, the regex itself is not correct. Try it out by starting simply copying or using the CommunityCommons.EmailAddressRegex

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

which checks on

before @, there is a word and possibly several times a ‘-’ or ‘+’ or ‘.’ and another word
then a @
then a word, then 0 or often a dot and a word, then once or more a dot and a two letter word

that will show you it works. Experiment on with more exotic regexes step by step and regex101.com is a nice regex-builder too.

The easiest way is to keep the regex simple and understandable. And if need be, you can double-check every failing email a second time by using one of the many online available services to check an email.

answered
1

I experience the same thing, following my learning path, rapid developer. Did you manage to solve this?  I tried several options, but nothing worked the way it is supposed to work.

Christine

 

answered
0

Even, i am facing the same issue. can anyone help me with this.

answered