note 92728 deleted from function.preg-match by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Aug 2011 13:10:20 +0000 |
| Subject: | note 92728 deleted from function.preg-match by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182144@lists.php.net to get a copy of this message | ||
Note Submitter: suit dot 2009 at rebell dot at
----
Reno's expression is still wrong.
The domain-part may contain lots of characters for IDN. IP adresses in the domain part are allowed.
In local-part are more characters allowed too but specific combinations are forbidden. Check RFC
2822 and RFC 2821.
"foo bar"@example.com is valid
foo\@bar@example.com is valid
$?^_`.!#{|}%&'*+-/=~@example.com is also valid e-mail-address (ok, quite uncommon example)
but
foo.@example.com is invalid, dot at beginning and end of the string is not allowed - but Reno's
expression would match.
an e-mail adress should not be longer than 256 characters (or 64 in local part, 255 in domain part)
since its limited by SMTP - check RFC 5321
Of course you should check RFC 2606 (Section 3) too - domain.tld or host.tld are not good as
example-domains. Use example.com / org / net (for domains) or .invalid / . example (for top level
domains).