#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.
#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