PHP Email Validation REGEX
$string = "first.last@domain.com.mx";
if (pregmatch(
'/^[^\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.";
}
Written by $( '#Cesar' )
Related protips
2 Responses
filtervar($email, FILTERVALIDATE_EMAIL) is all you need
over 1 year ago
·
Hey Tom!, you are right , but thats just for PHP 5 , its cool, but I did it this way just to play a little bit with REGEX :D
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#