note 38136 added to function.ereg
| From: | stephenaratfresnodotgov at rn2 dot php dot net | Date: | Tue, 09 Dec 2003 19:12:33 +0000 |
| Subject: | note 38136 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-61698@lists.php.net to get a copy of this message | ||
In addition to cwilliams at aerospace dot state dot al dot us:
The following section of the code does give false negatives for users who have a dot before the @,
as in (firstname dot lastname at ...):
//Do the basic Reg Exp Matching for simple validation
if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $Email)) {
return FALSE;
}
It can be corrected simply with:
//Do the basic Reg Exp Matching for simple validation
if (eregi("^[a-zA-Z0-9_\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $Email)) {
return FALSE;
}
----
Manual Page -- http://www.php.net/manual/en/function.ereg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38136
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38136&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38136&report=yes
Search -- http://master.php.net/manage/user-notes.php