Validating email address in java using regular expressions
They can get ridiculously convoluted as in the case above and, according to the specification, are often too strict anyway.
For this reason, for a time I began running any email address against the following regular expression instead: The local string the part of the email address that comes before the can contain any of these characters: But I wouldn't recommend using a regex as complex as this to search for email addresses through a large archive of documents or correspondence. This is the most efficient way. Just send your users an email.
It only allows them to fail faster when the input is not a valid email address. If that makes you nervous, then check for the dot too: