Perl-Email-Project / Email-Valid

perl library to validate email addresses
19 stars 19 forks source link

Issue #11 - Updated regex for rfc #12

Closed jpkboca closed 9 years ago

jpkboca commented 10 years ago

Updated regular expression for rfc 822

rjbs commented 10 years ago

This is a pretty big change to a pretty arcane hunk of code to be made without any explanation of why it's better. Why is it better?

rjbs commented 10 years ago

I see, because of https://github.com/rjbs/Email-Valid/issues/11 !

rjbs commented 10 years ago

Okay, I will have to write tests and stuff before merging this.

rjbs commented 9 years ago

I'm not sure I see the real problem here. Email::Valid is based on RFC822, and parses accordingly. See http://www.w3.org/Protocols/rfc822/#z10

On the other hand, it handles stripping these comments already. The address method returns the version without comments, so if Email::Valid is used properly, you won't end up with comments inside an address saved in a database. If you want to be quite strict, you can also compare the return value to the input.

I agree that it's sort of a mess, and I'd like to produce a better library, but right now I think it's better to use it as it works than to change its longstanding behavior.