Return to Snippet

Revision: 8466
at September 29, 2008 09:16 by Wardy


Updated Code
<?php
$string = "[email protected]";
if (preg_match(‘/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2}$/’,
$string)) 
{
   echo "example successful.";
}
?>

Revision: 8465
at September 24, 2008 06:00 by Wardy


Initial Code
<?php
$string = �[email protected]�;
if (preg_match(
�/^[^0-9][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://hmvrulz.wordpress.com/2008/09/22/8-practical-php-regular-expressions/

Initial Description


Initial Title
php - validating email address - Reg Expresion

Initial Tags
email, php

Initial Language
PHP