Open oschwald opened 9 years ago
That should be valid, yes. I am not enthused to poke that regex either. ;)
In my opinion such email address is not valid.
There are three different things: 1) Content of To header 2) ABNF grammar for mailbox field in RFCs 3) ABNF grammar for addr-spec filed in RFCs
If you are talking about list of email addresses then it is option 1) If you are talking about one email address phrase then it is option 2) And if you are talking about one bare email address (without phrase and without comments) then it is option 3).
And I understand that this modules check validity of email address as option 3. There is no support for comments or phrase...
I'm not sure that @pali's analysis is correct, please also see #36. Email::Valid accepts a number of complex formats, including "Firstname Lastname" (Comment) <address@domain.tld>
.
In the long run that regex will have to be changed at some point I guess, right now it is an ugly example of write-only code. See http://search.cpan.org/~miyagawa/Email-Valid-Loose-0.05/lib/Email/Valid/Loose.pm for a previous attempt to achieve that. I tried a similar approach on the current regex (which seems to be different) without success so far.
Hm... then first, module should document what kind of validation is doing (option 1., 2. or 3.) and after start start it fixing. Because it is really misleading.
From a brief review of RFC 5322, I think this is valid, even without a display-name. I'd submit a PR, but that regex is a thing of nightmares.