Return to Snippet

Revision: 7003
at January 8, 2010 19:10 by aristoworks


Updated Code
$string = "[email protected]"; 
if (preg_match(
'/^[^\W][a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*\@[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*\.[a-zA-Z]{2,4}$/',
$string)) { 
echo "example 3 successful.";
}

Revision: 7002
at July 1, 2008 09:34 by aristoworks


Initial Code
$string = "[email protected]"; 
if (preg_match(
'/^[^\W][a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*\@[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)*\.[a-zA-Z]{2,4}$/',
$string)) { 
echo "example 3 successful.";

Initial URL
http://www.thejwalker.com

Initial Description
A simple method of validating an email address using PHP and regular expressions

Initial Title
PHP (RegEx) Email Address Validation

Initial Tags
email, php, validation

Initial Language
PHP