note 43407 rejected from function.preg-match by victor
| From: | victor@php.net | Date: | Thu, 24 Jun 2004 22:39:28 +0000 |
| Subject: | note 43407 rejected from function.preg-match by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71623@lists.php.net to get a copy of this message | ||
Note Submitter: thhof@freenet.de
----
because email addresses containing dots in the domian name like 'test@domain.dyndns.org'
wont work, you need to change the preg_match arguments of webhamster's & zach's post
as follows:
<?PHP
$is_correct_spelled = preg_match("/^[-^!#$%&'*+\/=?`{|}~.\w]+@" .
"([-a-zA-Z0-9.]+\.)[-a-zA-Z0-9]{2,6}$/",$email);
?>
i also allowed tlds with a length up to 6.
this seems to work fine.