note 66478 added to function.preg-match
| From: | lcvalentineatgmaildotcom at osu1 dot php dot net | Date: | Tue, 23 May 2006 21:53:51 +0000 |
| Subject: | note 66478 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111900@lists.php.net to get a copy of this message | ||
After doing some testing for my company and reading the RFCs mentioned on wikipedia, I have found
that the following RegEx appears to match any standards-based e-mail address.
Please give test it in your own configs and respond if it works well so other users don't waste
too much time looking:
(remove breaks)
<?php
preg_match( "/^
[\d\w\/+!=#|$?%{^&}*`'~-]
[\d\w\/\.+!=#|$?%{^&}*`'~-]*@
[A-Z0-9]
[A-Z0-9.-]{1,61}
[A-Z0-9]\.
[A-Z]{2,6}$/i", 'user@subdom.dom.tld'
);
?>
----
Server IP: 216.194.113.175
Probable Submitter: 138.162.140.44
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/note/edit/66478
Del: integrated -- http://master.php.net/note/delete/66478/integrated
Del: useless -- http://master.php.net/note/delete/66478/useless
Del: bad code -- http://master.php.net/note/delete/66478/bad+code
Del: spam -- http://master.php.net/note/delete/66478/spam
Del: non-english -- http://master.php.net/note/delete/66478/non-english
Del: in docs -- http://master.php.net/note/delete/66478/in+docs
Del: other reasons-- http://master.php.net/note/delete/66478
Reject -- http://master.php.net/note/reject/66478
Search -- http://master.php.net/manage/user-notes.php