Hacker News new | past | comments | ask | show | jobs | submit login

According to the RFC compliant email regex,

   “\@“@example.com
is a valid email address, which your simplified test would reject.



Exactly.

The worst regex would be:

  /^[a-zA-Z0-9\-_]+@[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+$/
Because it would invalidates `my-email+custom-inbox@example.com`. And that's a pattern I use to automatically sort incoming mails.

Many websites use such a regex :(




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

Search: