Php function for validating email addresses No credit live sex web sites
Many email address validators will actually throw up errors when faced with a valid, but unusual, email address.
Many, for example, assume that an email address with a domain name extension of more than three letters is invalid.
I would go as far as to say that that regex you have made is useless.
There are three rfc's regarding emailaddresses and writing a regex to catch wrong emailadresses and and the same time don't have false positives is something no mortal can do.
RFC 2822, that specifies what is and is not allowed in an email address, states that the form of an email address must be of the form "local-part @ domain".If you want to learn more about email addresses I suggest you to start reading the specs, but I have to warn you it is not an easy read by any stretch: P. A note on the regex pattern used above (from the PHP source).It looks like there is some copyright on it of Michael Rushton.We're doing the same, combining two different methods we've seen.A regular expression to match most email addresses, exotic ones would likely be missed.
The "local-part" of an email address must be between 1 and 64 characters in length and may be made up in any one of three ways.