PDA

View Full Version : [OPEN]Email validation should allow a.van.b.-.van.c@domain.nl



devtig
3 Mar 2011, 11:48 PM
I know someone (she's married) having this email address:

her.husbandslastname.-.ownlastname@domain.nl

It is not validated with the current regexp:
(\w+)([\-+.][\w]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}

I suggest changing it to:
(\w+)([\-+.][\w\-]+)*@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}

evant
13 Mar 2011, 7:50 PM
It's a difficult problem, pretty well summed up here:

http://www.regular-expressions.info/email.html

devtig
13 Mar 2011, 11:04 PM
I know, but you can make it simple by adjusting the regexp based on user feedback like mine. The emailadres is positively a correct one (you can check through PM me).

Meanwhile you should maintain a list of valid and invalid email adresses and make sure that alterations to the regex to allow 1 more valid email format does not also positively validates an incorrect one on the list (and vice versa).

Floppie
20 Nov 2013, 11:50 AM
Are there plans to fix this? One of our users was recently impacted by it.