HTML and CSS Reference
In-Depth Information
17.5.7 Checking for Valid E-Mail Addresses
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 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 ( ).
At least one dot between the address and domain name ( .com , .mil , .edu , .se ).
At least six characters ( ). 3
Examples of valid e-mail addresses:
To break down a simple e-mail regular expression
use the following steps:
Step 1:
Go to the beginning of the line.
Step 2:
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
a row.
Step 3:
The username can consist of more than one set of
word characters separated by a single dots, as in
Step 4:
A literal @ symbol is required in the e-mail address.
Step 5:
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.
Search WWH ::

Custom Search