"異常.(),:;<>[]\".ຜິດປົກກະຕິ.\"அசாதரண@\\ \"অস্বাভাবিক\".არაჩ"@[IPv6:3ffe:1900:4545:3:200:f8ff:fe21:67cf] is a perfectly valid email address.
2. True, but you have to do something. :) What exactly is wrong with [email protected]? That could be valid domain at some point, right? You could filter those out but it's almost a preference sort of question. Does anyone think it would make sense to have "warning" level of validation for email addresses and let the user decide on these sort of examples? Just throwing it out there.
I don't see a problem with using a regex to validate email, unless you get false negatives. Rejecting anything that could be a valid e-mail address is bad and will cause frustration for someone at some point.
I don't think allowing validly formed e-mail addresses that don't have corresponding accounts (or even domains - consider a web app working in offline mode) is a bad thing, especially when taken with point 1, as surely the point of client side validation is a heads up to the user that the data is wrong, rather than actual validation?
Say it's a signup form. Your validator lets a bad email through. The potential client/customer left. You can't email them to ask for correct email. They are gone. They may never come back (depends of what they were there for, right?). In that case I would want to do as much as might be reasonable in order to ensure that I capture someone who might eventually translate into revenue.
In other cases it might be just fine to store absolute gibberish and deal with it later. That said, if you have an incredibly popular site and are receiving thousands upon thousands of sign-ups per day, do you really want to store junk? Someone is going to have to go clean it up before it is of any use.
Anyhow, my main point, perhaps, is that one should understand what these magic regex email validators are and are not. That's all.
The reason I bring this up whenever relevant is because I have been bitten by this problem in the past. I only understood the problem when an existing customer informed me that they could not sign-up to receive info on a new product because my email validator was kicking them out. He just picked-up the phone and called me. I never did learn how many people I lost because of that damn regex I grabbed from an authoritative source on the 'net.
If you absolutely must have valid email addresses the only sure way is to make them confirm it with information from an email sent to the address.
Scenario:
I somehow find myself at your landing page.
You have a single field for may email and a "Sign me up!" button.
I enter my email and sign up.
Your regex lies to you by thinking that the email is fine. In reality I made a mistake when I typed it in. I didn't notice it. Neither did your regex.
How are you going to contact me?
OK, if it is a small shop you can probably afford to have a human being review bounced emails and try to make some sense out of them. Well, what if you are signing up a thousand people a day?
Anyhow, the point is that a bad email addresses can cost you money both in customers that might never come back and also potentially in the manual work required to try to fix them manually.
A couple of points:
1- Client side validation is easy to circumvent. If you use this you have to make sure it is for UI only and that the real validation happens server side.
2- Using regex for email validation is fraught with issues. Probably the most salient one is that there are a million expressions out there. People run a quick google search, grab one and move on without knowing what they just plugged into their code. This particular tool will, for example, pass "[email protected]" as valid.
Other than that, I am sure this is a great time saver.