note 88101 deleted from function.preg-match by danbrown
| From: | danbrown@php.net | Date: | Sat, 10 Jan 2009 17:06:28 +0000 |
| Subject: | note 88101 deleted from function.preg-match by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149033@lists.php.net to get a copy of this message | ||
Note Submitter: xep
----
previous pattern is buggy. use this:
<?php
$pattern = '/^[a-z][a-z0-9\._-]*[a-z0-9_-]+' .
'@[a-z0-9]+(?:[\._-][a-z0-9]+)*\.[a-z]{2,4}$/i';
$email = "email----address..to..validate" .
"-az..09_AZ--__--@host.dOMain.cOM";
echo preg_match ($pattern, $email);
?>