note 67998 deleted from function.preg-match by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 18:31:40 +0000 |
| Subject: | note 67998 deleted from function.preg-match by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127629@lists.php.net to get a copy of this message | ||
Note Submitter: najeli at gmail dot com
----
A little comment to lcvalentine mail validation expression - it recognizes emails like
"user@fo.com" as non valid, but there are some valid ones (at least in Poland, ex. wp.pl,
o2.pl etc.).
After changing {1,61} to {0,61} everything works fine, I hope.
<?php
preg_match( "/^
[\d\w\/+!=#|$?%{^&}*`'~-]
[\d\w\/\.+!=#|$?%{^&}*`'~-]*@
[A-Z0-9]
[A-Z0-9.-]{0,61}
[A-Z0-9]\.
[A-Z]{2,6}$/i", 'user@subdom.dom.tld'
);
?>
(remove breaks)