You actually should at least use regex to check some basic things. Like "@" "." or even just disallowed characters. As someone who sends a LOT of email for customers every week, a big percentage of our problem is incorrectly formatted emails. So we just don't even let them in these days. People are forgetting that for services that have to send email it costs dearly to bounce. Bounces decrease the quality of your lis…
Please don't check for a full-stop/period. It excludes those who have their email address directly on a TLD.
Stop Validating Email Addresses with Regex (2012)
51–60 of 228 posts
Re: Stop Validating Email Addresses with Regex (2012)
#52My primary email addresses are on two TLDs, one of which has been around for 24 years, the other for seven years, but about 10% of sites I try to register on refuse to accept them, saying that they are not valid. They clearly have not updated some internal whitelist since these TLDs were added.
I just had one major ecommerce go into their DB and update my address. This was a bad idea because now my profile page has an error and I can't change anything else.
STOP THIS. JUST STOP.
Re: Stop Validating Email Addresses with Regex (2012)
#53This won't be popular, but: 1. An experienced dev just killed 54k stars on GitHub due to pressing a button in an auto-pilot mode. Do you think a Joe High who wants to give you $100 won't ever type '2' instead of '@'? What about an old lady? Or someone with physical difficulties? Have you personally ever made a typo in an email? 2. That code in the article is not color highlighted (rainbowed for Regex) or formatted pr…
I do like to check for '@' to enure the user have not entered their name or something by mistake, but beyond that the syntactic validation does not provide any value.
Re: Stop Validating Email Addresses with Regex (2012)
#54Earlier quoted context omitted.
Please don't check for a full-stop/period. It excludes those who have their email address directly on a TLD.
Is that an existing cohort? I'm not saying it isn't, I've just not run across them.
Re: Stop Validating Email Addresses with Regex (2012)
#55Re: Stop Validating Email Addresses with Regex (2012)
#56One of the best validation techniques I heard was check for an "@" symbol and if they have one the call it good.
Re: Stop Validating Email Addresses with Regex (2012)
#57It’s is one of those “technically” vs “practicality” things, not using a regex will cause you more customer support problems than solve.
I run an online store, typoed email addresses are one of the top causes of customers contacting support. In 10 years we have never had a customer contact us to complain their “valid” email address won’t be excepted on our site. If we were to remove the regex from the validation and “just try to send an email” as suggested it would create so much more work for our support team.
You should also implement some “soft” validation looking for common typos, although people still somehow make those mistakes. I’m convinced that some people have types in their autocomplete address book.
Re: Stop Validating Email Addresses with Regex (2012)
#58One of the best validation techniques I heard was check for an "@" symbol and if they have one the call it good.
Re: Stop Validating Email Addresses with Regex (2012)
#59Can't upvote this enough. There simply is no need to check the email addr provided by the user. Send the mail, if it bounces, the user has only himself to blame. What if I don't want them to go through the hassle of an activation link? Then I don't bother with an email account in the sign-up process in the first place. If they want a passwd reset method, they can later provide an email in their settings page, if that…
Don't put up a web page where any visitor can put in an e-mail address, to which you send something, without any safeguards: like not sending to the same e-mail address more than just several times in a 24 hour period or something.
Have Captches or or something to reduce the bots. Proof of work. Whatever.
It may be wise to validate not for valid e-mail address syntax, but for certain invalid e-mail addresses to which you shouldn't send.
For instance, would any legitimate user be subscribing with an e-mail address of postmaster@example.com? It seems it would be worth it to have a database of patterns of at least some well known mailing list addresses. Certain domains are almost certainly mailing lists; e.g. anything@vger.kernel.org is probably a list; don't send to it.
Process bounces.
Re: Stop Validating Email Addresses with Regex (2012)
#60This won't be popular, but: 1. An experienced dev just killed 54k stars on GitHub due to pressing a button in an auto-pilot mode. Do you think a Joe High who wants to give you $100 won't ever type '2' instead of '@'? What about an old lady? Or someone with physical difficulties? Have you personally ever made a typo in an email? 2. That code in the article is not color highlighted (rainbowed for Regex) or formatted pr…