note 90783 deleted from function.preg-match by danbrown
| From: | danbrown@php.net | Date: | Sat, 09 May 2009 18:59:11 +0000 |
| Subject: | note 90783 deleted from function.preg-match by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-154397@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
FILTER_VALIDATE_EMAIL is very poor at validating email addresses. Misses all sorts of things.
This RegEx is much much better. http://SimonSlick.com/VEAF/
For example it fails the following plus a whole lot more:
""@domain.tld is valid (empty double quoted local part is RFC compliant)
local-part@tld is valid (tld only domain is RFC compliant)
local-part@domain-label-longer-than-63-octets.tld is not valid (RFC restricts domain labels to 63
octets each)
local-part@domain.tld- is not valid (domain labels can not end with hyphen)
local-part@[address-literal]
"local\"part"@domain.tld is valid