You're viewing a comment by you and its responses.

you Permalink
November 13, 2011, 14:28

#112 is VERY bad. If you ever have to validate an email address, you might want to speed a few minutes and find a regex that does it right. It is a complex problem that does deserve some time. Do NOT roll your own solution just because you [think you] can.

In this case, enforcing the dot in the domain part is a bad idea not only because it violates the standard (that would be RFC 822) because there are legitimate use cases. for example:

* special domains (like "localhost" for example (there *are* others). Administrative mail on linux gets delivered to root@localhost by default.)
* gtlds
* intranet-only applications where clients have a dns search domain

I know of one company that has two dozen (no kidding) different functions their flagship product that are supposed to validate email addresses. Most of them are non-trivial and definitely took some time to implement. Not one of them is correct.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "halflife3_277": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.