note 66478 deleted from function.preg-match by colder

From: Date: Mon, 18 Jun 2007 18:30:46 +0000
Subject: note 66478 deleted from function.preg-match by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127627@lists.php.net to get a copy of this message
Note Submitter: lcvalentine at gmail dot com ---- 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' ); ?>

« previous php.notes (#127627) next »