Return to Snippet

Revision: 32734
at February 22, 2011 03:39 by tuffo19


Updated Code
$pattern = "/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i";
		
if(preg_match($pattern, "[email protected]"))
     echo "ok";
     else echo "no";

Revision: 32733
at October 2, 2010 01:32 by tuffo19


Initial Code
$pattern = "/^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$/i";
		
if(preg_match($pattern, "[email protected]"))
     echo "ok";
     else echo "no";

Initial URL
email_validator

Initial Description
Definitivo. Errore bassissimo.

Initial Title
Validate email address

Initial Tags
email, php, validation

Initial Language
PHP