Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe. I all know is that no one should have to write a regexp like this one http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html


the regexp is very impressive, but it's not quite as bad as it would want you to believe. The regexp also matches real names in addresses and lists of addresses.

Usually, in forms, you would ask for the real name and for the email address in separate fields and you wouldn't allow lists to be passed in.

I do agree though: The email address format is (even without the real name part) too complicated to really validate. In my applications, I check if there's an @-sign (I usually need a proper SMTP email address to deliver anyways), but leave the rest to the mail server on send-time, handling the bounces.


I believe that misses some edge cases as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: