note 38136 deleted from function.ereg by irchtml

From: Date: Wed, 25 Feb 2004 17:30:36 +0000
Subject: note 38136 deleted from function.ereg by irchtml
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-65741@lists.php.net to get a copy of this message
Note Submitter: stephenar at fresno dot gov ---- 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; }

« previous php.notes (#65741) next »