note 37028 added to function.ereg
| From: | admin2 at ocularbox dot com | Date: | Fri, 31 Oct 2003 05:28:36 +0000 |
| Subject: | note 37028 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59555@lists.php.net to get a copy of this message | ||
For people who have a good deal of .something.something.something.co.uk, for example, at the end of
the email addresses they wish to validate. Here is a pattern that accepts upper and lower case
alpha, and numeric, "-", "_", ".", followed by a "@", and
the same rules as previously stated (only it doesn't accept ".", that's how it
finds the end of the root domain) followed by a "." then any number of "." +
string. As long as there is ".??" (IE ".bz" or ".uk")
^[_\.0-9a-zA-Z\-]+@([a-z0-9A-Z_\-])+\.([a-z0-9\.]){2,}$
valid: Foo_Bar.vice-pres@foo_net-net.com.co.uk
*This may be less than perfect, please do not grill me for it
----
Manual Page -- http://www.php.net/manual/en/function.ereg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37028
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37028&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37028&report=yes
Search -- http://master.php.net/manage/user-notes.php