note 68099 deleted from function.preg-match by colder
| From: | colder@php.net | Date: | Mon, 18 Jun 2007 18:31:45 +0000 |
| Subject: | note 68099 deleted from function.preg-match by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-127630@lists.php.net to get a copy of this message | ||
Note Submitter: pnomolos --- gmail --- com
----
A note to lcvalentine and najeli ... to make things much easier, you can include 'x' in
the regular expression modifiers which makes whitespace outside of character classes mean nothing
(meaning you don't have to remove breaks), as well as allowing you to comment the regular
expression... like so!
preg_match( "/^
[\d\w\/+!=#|$?%{^&}*`'~-] # Wow that's ugly looking
[\d\w\/\.+!=#|$?%{^&}*`'~-]*@ # So's that one
[A-Z0-9]
[A-Z0-9.-]{0,61}
[A-Z0-9]\. # Letters or numbers, then a dot
[A-Z]{2,6}$/ix", 'user@subdom.dom.tld'
);