Re: Valid email address syntax script?
| From: | Jason Sweeney | Date: | Wed, 04 May 2005 15:42:06 +0000 |
| Subject: | Re: Valid email address syntax script? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-214443@lists.php.net to get a copy of this message | ||
Borrowed with great reverence from http://ca3.php.net/function.mail:
$regex = '^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]{2,})+$';
if (eregi($regex, $email))
return true;
else
return false;
jason sweeney
jason.designshift.com
JM wrote:
Does anyone have a nice email address syntax checking script they'd like to share? Regular expression-based anyone? TIA.