Hacker News new | past | comments | ask | show | jobs | submit login
Comparing E-mail Address Validation Regular Expressions (fightingforalostcause.net)
5 points by soundsop on Oct 3, 2008 | hide | past | favorite | 1 comment



Has it occurred to no-one that there are better ways to validate an email than a regex?

I wrote a quick little function once after reading the relevant RFCs that scores 16/17 valid and 14/19 invalid on his test in O(n) time. I could up that but most of the failure cases are really unlikely.

Also, the test cases listed don't cover everything, like email addresses of the form "I'm in quotes @#$!!!(&^*_+="@domain.com which are technically valid.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: