HTML and CSS Reference
When validating an e-mail address, you are looking for the typical format found in such
addresses. There might be some domain names that are more than three characters, but
it isn't typical. Also, just because the user types what looks like a valid e-mail address,
that does not mean that it is; for example, the e-mail address firstname.lastname@example.org uses a
valid syntax, but that fact does not prove that santa is a real user.
E-mail addresses usually have the following format:
An @ sign between the username and address ( email@example.com ).
At least one dot between the address and domain name ( .com , .mil , .edu , .se ).
At least six characters ( firstname.lastname@example.org ). 3
Examples of valid e-mail addresses:
To break down a simple e-mail regular expression
use the following steps:
Go to the beginning of the line.
The username consists of one or more dashes or word
characters grouped by parentheses, followed by one
(or not one) literal period. Because the dot is outside
the parentheses, there will be either one or zero dots
for the list of word characters, not two or three dots in
The username can consist of more than one set of
word characters separated by a single dots, as in
A literal @ symbol is required in the e-mail address.
The mail server's name is like the user's name, a group
of word characters separated by a dot.
3. As of this writing, domain names have at least two characters.