| Limitations of the Basic Syntax |
| Article Index |
|---|
| Limitations of the Basic Syntax |
| Page 2 |
| Page 3 |
| Page 4 |
Page 4 of 4
[A-Za-z0-9_]+@[A-Za-z0-9_]+\.[A-Za-z0-9_]{2,4}
Naturally, you may want to allow only email addresses that have a three-letter domain (such as .com). This can be accomplished by omitting the comma and max parameters from the length specifiers:
[A-Za-z0-9_]+@[A-Za-z0-9_]+\.[A-Za-z0-9_]{3}
If, on the other hand, you would like to leave the maximum number of characters open in anticipation of the fact that longer domain extensions may be introduced in the future, you could use the following regex:
[A-Za-z0-9_]+@[A-Za-z0-9_]+\.[A-Za-z0-9_]{3,}
This indicates that the last regex in the expression should be repeated at least a minimum of three times, with no fixed upper limit.
This entry was posted on . You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a comment.
Tags: Simple PHP, Pear, Easy PHP, PHP Tutorial, PHP MySQL, XSLT, Sap Tutorial, CSS Tutorial, XSL FO Java, SQL Tutorial.
| Users' Comments (0) |
|
No comment posted








