It is also a valid SMTP address, assuming you have defined "b" as a FQDN in your DNS.
What we have here is a list of TLDs which have MX records, but an MX record is not even required to send mail to a FQDN. An A record will suffice, for any RFC compliant SMTP server.
Last week I got into a discussion with a client over email validation rules; they wanted "contains an '@' and a '.'". Even after explaining that the '.' was optional they insisted n these rules.
Which made be wonder just how many problems will be seen once companies can use vanity top level domains; if I buy the "doug" TLD how long before I give up on lost email and switch from me@doug back to me@doug.com?
Sorry but "your servers" do not set the specifications for what is and what is not a valid email address. It always amazes me why people waste time with regular expressions to try and determine if an email address is valid or not before sending an email.
The best and by far easiest way to determine if an email address is valid is to just send an email to it. Your regular expression matches invalid email addresses (like anything@____.com) and misses things like "This is valid"@example.com.
> It always amazes me why people waste time with regular expressions to try and determine if an email address is valid or not before sending an email
Some of us want to check if a newly entered email address appears valid while we still have the user on our site, so if there is an obvious problem we can get it fixed.
How do you address that with the "just send an email" approach? If the mail bounces, how do I contact the user to tell them to come back to the site and try again?
Correct approach: display a warning that says something like "We think you've mistyped your email address. Please re-enter it, otherwise click 'submit' if you think we're wrong :)"
I'm tired of sites not accepting perfectly valid symbols like "+" in my email address.
The problem with your script, though is that you have to manually update it, like you did with aero, museum, xxx, etc. A much better, albeit slightly more expensive solution, is to get the domain and see if it actually exists and has an mx record, because as this shows, there are times when that regex falls apart.
It is also a valid SMTP address, assuming you have defined "b" as a FQDN in your DNS.
What we have here is a list of TLDs which have MX records, but an MX record is not even required to send mail to a FQDN. An A record will suffice, for any RFC compliant SMTP server.