note 42872 rejected from function.preg-match by aidan
| From: | aidan@php.net | Date: | Sun, 04 Jul 2004 16:21:15 +0000 |
| Subject: | note 42872 rejected from function.preg-match by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72527@lists.php.net to get a copy of this message | ||
Note Submitter: webhamster from ovenjoy point com
----
surely this is even better, assuming all email addresses end with 2, 3 or 4 chars:
preg_match("/^[-^!#$%&'*+\/=?`{|}~.\w]+@" .
"([-a-zA-Z0-9]+\.)[-a-zA-Z0-9]{2,4}$/",$email);
(concatenated in order to fit page)