<?php

/*

* Source: http://www.pgregg.com/projects/php/code/showvalidemail.php

*

* Email Validation (syntax/format only) is frequently a hotly discussed

* topic on forums, irc channels and blogs. Some people believe that to be

* "correct" your pattern should be RFC 822/2822 complient, others fall into

* the take anything camp.

* Personally, I believe a more liberal approach is necessary - the spirit of

* RFCs is "Be strict in what you send and liberal in what you receive".

* Many email addresses might not be strictly to RFC pattern spec, but they

* work just fine, and in these days of multibyte characters and "foreign"

* character sets, the picture becomes a lot more complicated.

*

* This script was put together to test several different email syntax regex

* validation patterns that I've come across on my travels - though mostly

* from the EfNet #php irc channel.

*

* Author and Copyright of this code: Paul Gregg, 2002-2008

* http://www.pgregg.com

* Copyright of the various patterns remain with the named authors.

*

*/





include "validate_email.inc.phps" ;

// is_email function from http://www.dominicsayers.com/isemail/

include "dominicsayers.php" ;





echo <<<EOPAGETOP

<html><head>

<title>Email regex?</title>

<style type="text/css">

* {

margin: 10px;

padding: 2px;

}

body {

background: #f7f7f7;

//font-size: 12px;

font-family: tahoma;

}

table.file_list {

border: solid 1px #ccc;

width: 95%;

font-size: 12px;

margin: auto;

}

table.file_list td {

padding: 3px;

}

table.file_list .a td {

background: #eee;

}

table.file_list .b td {

background: #f7f7f7;

}

table.file_list .header td {

background: #ddd;

font-weight: bold;

}

table.file_list .N {

font-weight: bold;

}

table.file_list .Y {

//font-weight: bold;

}

</style>

</head>

<body>

<p>Demonstrating why email regexs are (mostly) poor.</p>

<p><b>Important notes</b>

<br> Email Validation (syntax/format only) is frequently a hotly discussed

topic on forums, irc channels and blogs. Some people believe that to be

"correct" your pattern should be RFC 822/2822 complient, others fall into

the take anything camp.

Personally, I believe a more liberal approach is necessary - the spirit of

RFCs is "Be strict in what you send and liberal in what you receive".

<br>Many email addresses might not be strictly to RFC pattern spec, but they

work just fine, and in these days of multibyte characters and "foreign"

character sets, the picture becomes a lot more complicated.

</p>

EOPAGETOP;







$emailregex = array (

'pgregg\'s <a href="validate_email.inc.phps">validate_email</a>' => 'Function:ValidateEmail' ,

'arpad' => '/[^@]@(?:(?:[a-z\d-]+\.)+[a-z\d]{2,6}|\[(?:\d{1,3}\.){3}\d{1,3}\])\z/si' ,

'Rejected' => '/[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}/i' ,

'jome' => '#^.+@.+\..+$#' ,

'Skiz' => '/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/' ,

'Lazesharp' => "#^[\w.%-]+ @ [\w.%-]+ (com|net|org|gov|edu|mil|int|arpa|aero|biz|coop|info|museum|name|pro|asia|cat|jobs|mail|mobi|post|tel|travel|xxx|co|me) (\.[A-Z]{2})? $#ix" ,

'Shadda' => "/^\w+@\w+(\.\w{2,3})*\.\w+$/" ,

'Shai-Tan' => "/^\S+@[\w\d.-]{2,}\.[\w]{2,6}$/iU" ,

'DaSourcerer' => '/^("?)(?i:[a-z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\|\}~]+[a-z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\|\}~\.]*[a-z0-9!#\$%&\'\*\+\-\/=\?\^_`\{\|\}~]+)\\1@(?i:[a-z][a-z0-9\-]+\.)+([a-z]{2}|com|org|net|biz|info|name|aero|biz|info|jobs|museum|name)$/' ,

'Slynderdale' => '#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s\'"<>]+\.+[a-z]{2,6}))$#si' ,

'cronus_' => "#\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*#" ,

'asonge' => "/^[\w!#$%&\'*+-\/=?^_`{|}~]+(?:\.[\w!#$%&\'*+-\/=?^_`{|}~]+)*@(?:(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|(?:[a-z0-9-]+\.)+(?:arpa|com|edu|gov|int|mil|net|org|biz|info|name|pro|aero|coop|museum|[a-z]{2}))$/i" ,

#'zfw_isEmail' => 'Function:zfw_isEmail',

'php-filter_var' => 'Function:php_filter_var' ,

'arpad2' => '/^\s*[\w+." -]+@(?:(?:[a-z\d]+(?:-[a-z\d]+)*\.)+[a-z\d]{2,6}|\[(?:(25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]?\d?\d)\])\s*$/si' ,

'NiteLiteW' => "#^[a-z0-9,!\#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!\#\$%&'\*\+/=\?\^_`\{\|}~-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2,})$#" ,

'asonge2' => '/^(?:[a-z0-9!#$%*\/?|^{}`~&\'+=_.-]+|"(?:(?:\\\\\\\\)*\\\\"|[^\\\\"]+)*")@(?:(\[)(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(?(1)\]|)|(?:(?:[a-z0-9]+(?:-[a-z0-9]+)*)+\.)+[a-z]{2,6})$/i' ,

'HM2K' => '/^((?:(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:(?:[\x41-\x5a\x61-\x7a]|[\x30-\x39]|[\x21\x23-\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b-\x7e])+(?:\x2e(?:[\x41-\x5a\x61-\x7a]|[\x30-\x39]|[\x21\x23-\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b-\x7e])+)*)(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?)|(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?\x22(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|[\x21\x23-\x5b\x5d-\x7e])|(?:\x5c[\x01-\x09\x0b\x0c\x0e-\x7f]|(?:\x5c[\x00-\x7f]))))*(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?\x22(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?)|(?:(?:(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:[\x41-\x5a\x61-\x7a]|[\x30-\x39]|[\x21\x23-\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b-\x7e])+(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?)|(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?\x22(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|[\x21\x23-\x5b\x5d-\x7e])|(?:\x5c[\x01-\x09\x0b\x0c\x0e-\x7f]|(?:\x5c[\x00-\x7f]))))*(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?\x22(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?))(?:\x2e(?:(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:[\x41-\x5a\x61-\x7a]|[\x30-\x39]|[\x21\x23-\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b-\x7e])+(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?)|(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?\x22(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|[\x21\x23-\x5b\x5d-\x7e])|(?:\x5c[\x01-\x09\x0b\x0c\x0e-\x7f]|(?:\x5c[\x00-\x7f]))))*(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?\x22(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?)))*))\x40(?:(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:(?:[\x41-\x5a\x61-\x7a]|[\x30-\x39]|[\x21\x23-\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b-\x7e])+(?:\x2e(?:[\x41-\x5a\x61-\x7a]|[\x30-\x39]|[\x21\x23-\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b-\x7e])+)*)(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?)|(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?\x5b(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|[\x21-\x5a\x5e-\x7e])|(?:\x5c[\x01-\x09\x0b\x0c\x0e-\x7f]|(?:\x5c[\x00-\x7f]))))*(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?\x5d(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?)|(?:(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:[\x41-\x5a\x61-\x7a]|[\x30-\x39]|[\x21\x23-\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b-\x7e])+(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?)(?:\x2e(?:(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?(?:[\x41-\x5a\x61-\x7a]|[\x30-\x39]|[\x21\x23-\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b-\x7e])+(?:(?:(?:[\x20\x09]*(?:\x0d\x0a))?[\x20\x09]+)|(?:[\x20\x09]+(?:(?:\x0d\x0a)[\x20\x09]+)*))?))*)))$/' ,

'HM2K 2' => '/^[\w!#$%&\'*+\/=?^`{|}~.-]+@(?:[a-z\d][a-z\d-]*(?:\.[a-z\d][a-z\d-]*)?)+\.(?:[a-z][a-z\d-]+)$/iD' ,

'arpad3' => '/^(?:"(?:\\\\.|[^"])*"|[^@]+)@(?=[^()]*(?:\([^)]*\)[^()]*)*\z)(?![^ ]* (?=[^)]+(?:\(|\z)))(?:(?:[a-z\d() ]+(?:[a-z\d() -]*[()a-z\d])?\.)+[a-z\d]{2,6}|\[(?:(?:1?\d\d?|2[0-4]\d|25[0-4])\.){3}(?:1?\d\d?|2[0-4]\d|25[0-4])\]) *\z/si' ,

'archtech' => '/^[\w%.\'!#$&*+\/=?^`{|}~-]{1,64}@(?:[a-z\d][a-z\d-]+)+(?:\.[a-z\d][a-z\d-]+)+$/iD' ,



'php-filter_validate_email' => "/^((\\\"[^\\\"\\f\

\\r\\t\\v\\b]+\\\")|([\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+(\\.[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\~\\/\\^\\`\\|\\{\\}]+)*))@((\\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\\-])+\\.)+[A-Za-z\\-]+))$/" ,

'stevew' => '/(^(?!.*?\.\.)[^.][a-zA-Z0-9_.+-]+[^.]@[^.-][a-zA-Z0-9-\[\]]+\.[a-zA-Z0-9-.\[\]]+$)/' ,

#'rfc822' => '#'.perl_rfc822().'#',

'Jan Goyvaerts http://chris.602.org/temp/email_regex_preg.txt' => '/\\A(?:(?:(?:\\r\

)?[ \\t])*(?:(?:(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|"(?:[^\\"\\r\\\\]|\\\\.|(?:(?:\\r\

)?[ \\t]))*"(?:(?:\\r\

)?[ \\t])*)(?:\\.(?:(?:\\r\

)?[ \\t])*(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|"(?:[^\\"\\r\\\\]|\\\\.|(?:(?:\\r\

)?[ \\t]))*"(?:(?:\\r\

)?[ \\t])*))*@(?:(?:\\r\

)?[ \\t])*(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\

)?[ \\t])*)(?:\\.(?:(?:\\r\

)?[ \\t])*(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\

)?[ \\t])*))*|(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|"(?:[^\\"\\r\\\\]|\\\\.|(?:(?:\\r\

)?[ \\t]))*"(?:(?:\\r\

)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<>@,;:\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\

)?[ \\t])*)(?:\\.(?:(?:\\r\

)?[ \\t])*(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\

)?[ \\t])*))*)*:(?:(?:\\r\

)?[ \\t])*)?(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|"(?:[^\\"\\r\\\\]|\\\\.|(?:(?:\\r\

)?[ \\t]))*"(?:(?:\\r\

)?[ \\t])*)(?:\\.(?:(?:\\r\

)?[ \\t])*(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|"(?:[^\\"\\r\\\\]|\\\\.|(?:(?:\\r\

)?[ \\t]))*"(?:(?:\\r\

)?[ \\t])*))*@(?:(?:\\r\

)?[ \\t])*(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\

)?[ \\t])*)(?:\\.(?:(?:\\r\

)?[ \\t])*(?:[^()<>@,;:\\\\".\\[\\] \\x00-\\x1F]+(?:(?:(?:\\r\

)?[ \\t])+|\\Z|(?=[\\["()<>@,;:\\\\".\\[\\]]))|\\[([^\\[\\]\\r\\\\]|\\\\.)*\\](?:(?:\\r\

)?[ \\t])*))*\\>(?:(?:\\r\

)?[ \\t])*))*)?;\\s*))\\z/' ,



'dominicsayers <a href="http://www.dominicsayers.com/isemail/" ref="nofollow">is_email</a>' => 'Function:is_email' ,



);

/*

$rfc822 = '#' . perl_rfc822() . '#i';

print $rfc822;

Function ValidateEmail4($emailstr) {

global $rfc822;

return (bool)preg_match($rfc822, $emailstr);

}

*/



#http://framework.zend.com/issues/browse/ZF-42

Function zfw_isEmail ( $value )

{

/**

* @todo RFC 2822 (http://www.ietf.org/rfc/rfc2822.txt)

*/

$atom = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]' ;

$domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)' ;

$regex = '^' . $atom . '+' . '(\.' . $atom . '+)*\@(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$' ;



if ( eregi ( $regex , $value ))

{

return $value ;

}



return false ;

}



Function php_filter_var ( $value ) {

if( filter_var ( $value , FILTER_VALIDATE_EMAIL ) === FALSE ) return false ;

return $value ;

}



$tests = array(

'name.lastname@domain.com' => true ,

'.@' => false ,

'a@b' => false ,

'@bar.com' => false ,

'@@bar.com' => false ,

'a@bar.com' => true ,

'aaa.com' => false ,

'aaa@.com' => false ,

'aaa@.123' => false ,

'aaa@[123.123.123.123]' => true ,

'aaa@[123.123.123.123]a' => false , # extra data outside ip

'aaa@[123.123.123.333]' => false , # not a valid IP

'a@bar.com.' => false ,

'a@bar' => false ,

'a-b@bar.com' => true ,

'+@b.c' => false , # min 2 char tld

'+@b.com' => true ,

'a@-b.com' => false ,

'a@b-.com' => false ,

'-@..com' => false ,

'-@a..com' => false ,

'a@b.co-foo.uk' => true ,

'"hello my name is"@stutter.com' => true ,

'"Test \"Fail\" Ing"@example.com' => true ,

'valid@special.museum' => true ,

'invalid@special.museum-' => false ,

'shaitan@my-domain.thisisminekthx' => true , # tld way too long (no longer)

'test@...........com' => false , # ......

'foobar@192.168.0.1' => false , # ip need to be []

// from reading http://haacked.com/archive/2007/08/21/i-knew-how-to-validate-an-email-address-until-i.aspx

'"Abc\@def"@example.com' => true ,

'"Fred Bloggs"@example.com' => true ,

'"Joe\\Blow"@example.com' => true ,

'"Abc@def"@example.com' => true ,

'customer/department=shipping@example.com' => true ,

'$A12345@example.com' => true ,

'!def!xyz%abc@example.com' => true ,

'_somename@example.com' => true ,

'Test \\' . chr ( 10 ). ' Folding \\' . chr ( 10 ). ' Whitespace@example.com' => true ,

'HM2Kinsists@(that comments are allowed)this.is.ok' => true ,

'user%uucp!path@somehost.edu' => true ,

'user@domain.NORTHWESTERNMUTUAL' => true ,

'punycode@domain.XN--VERMGENSBERATUNG-PWB' => true ,

);





echo "<br />

Matrix of Emails against Email validation checkers:<br />" ;

echo '<br />Key: * indicates deviation from the "validity" of the email' ;

echo '<br />Key: Y* indicates test is lax and would let an invalid email through' ;

echo '<br />Key: <span style="font-weight: bold;">N*</span> indicates test is too strict and could potentially block a valid email address (more serious than an over-permissive Y*)<br /><br />' ;



// Display the table header row

echo '<table cellpadding=4 cellspacing=0 class="file_list"><tr class="header"><td>Input</td><td>Valid?</td>' ;

foreach ( $emailregex as $submitter => $regex ) {

if ( preg_match ( '/^Function:/' , $regex ))

$regexsize = '<br/><i>function</i>' ;

else

$regexsize = '<br/><i>' . strlen ( $regex ) . ' chars</i>' ;

echo '<td>' , $submitter , $regexsize , '</td>' ;

}

echo '</tr>' ;



$errorcount = array();

$rowcount = 0 ;

foreach ( $tests as $test => $isvalid ) {

$rowclass = (++ $rowcount % 2 == 1 ? 'a' : 'b' );

$isvalidyn = ( $isvalid ? 'Y' : 'N' );



echo '<tr class="' , $rowclass , '"><td>\'' , $test , '\'</td><td>' , $isvalidyn , '</td>' ;

foreach ( $emailregex as $submitter => $regex ) {

if (!isset( $errorcount [ $submitter ])) $errorcount [ $submitter ] = 0 ;

if ( preg_match ( '/^Function:/' , $regex )) { // call the function

list( $crap , $func ) = explode ( ':' , $regex );

$result = ( call_user_func ( $func , $test ) !== false );

} else

$result = ( preg_match ( $regex , $test ) > 0 );

$resultyn = $result ? 'Y' : 'N' ;

printf ( '<td class="%s">%s%s%s%s</td>' ,

( $result != $isvalid && $result === false ) ? 'N' : 'Y' ,

'' , #($result != $isvalid && $result === false) ? '<b>' : '',

#$resultyn . '(result='.($result?'true':'false').') (resultyn='.$resultyn.')',

$resultyn ,

$result != $isvalid ? ' *' : '' ,

( $result != $isvalid && $result === false ) ? '</b>' : ''

);

if ( $result != $isvalid ) $errorcount [ $submitter ]++;

}

echo '</tr>' ;

}

// display "error" totals

echo '<tr><td>Total differences</td><td> </td>' ;

foreach ( $emailregex as $submitter => $regex ) {

echo '<td><hr>' , $errorcount [ $submitter ], '</td>' ;

}

echo '</tr>' ;

echo "</table><br>" ;



Function perl_rfc822 () {

#rfc822 regex from http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

$rfc822 = <<<EOWTF

(?:(?:\r

)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t]

)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:

\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(

?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[

\t]))*"(?:(?:\r

)?[ \t])*))*@(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0

31]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\

](?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+

(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:

(?:\r

)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z

|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)

?[ \t])*)*\<(?:(?:\r

)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\

r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[

\t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)

?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t]

)*))*(?:,@(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[

\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*

)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t]

)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*))*)

*:(?:(?:\r

)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+

|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r



)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:

\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t

]))*"(?:(?:\r

)?[ \t])*))*@(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031

]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](

?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?

:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?

:\r

)?[ \t])*))*\>(?:(?:\r

)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?

:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?

[ \t]))*"(?:(?:\r

)?[ \t])*)*:(?:(?:\r

)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\]

\000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|

\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>

@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"

(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])*))*@(?:(?:\r

)?[ \t]

)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\

".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?

:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[

\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-

\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(

?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])*)*\<(?:(?:\r

)?[ \t])*(?:@(?:[^()<>@,;

:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([

^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\"

.\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\

]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*))*(?:,@(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\

[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\

r\\]|\\.)*\](?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\]

\000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]

|\\.)*\](?:(?:\r

)?[ \t])*))*)*:(?:(?:\r

)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0

00-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\

.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,

;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?

:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])*))*@(?:(?:\r

)?[ \t])*

(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".

\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t])*(?:[

^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]

]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*))*\>(?:(?:\r

)?[ \t])*)(?:,\s*(

?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\

".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])*)(?:\.(?:(

?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[

\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t

])*))*@(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t

])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*)(?

:\.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|

\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*))*|(?:

[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\

]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])*)*\<(?:(?:\r

)

?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["

()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)

?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>

@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*))*(?:,@(?:(?:\r

)?[

\t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,

;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*)(?:\.(?:(?:\r

)?[ \t]

)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\

".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*))*)*:(?:(?:\r

)?[ \t])*)?

(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\["()<>@,;:\\".

\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])*)(?:\.(?:(?:

\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z|(?=[\[

"()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r

)?[ \t]))*"(?:(?:\r

)?[ \t])

*))*@(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])

+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*)(?:\

.(?:(?:\r

)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r

)?[ \t])+|\Z

|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r

)?[ \t])*))*\>(?:(

?:\r

)?[ \t])*))*)?;\s*)

EOWTF;

return str_replace ( "

" , '' , $rfc822 );

}



echo '<font face="courier">' ;

show_source ( __FILE__ );

