Demonstrating why email regexs are (mostly) poor.
Important notes
 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 international
 character sets, the picture becomes a lot more complicated.
| Input | Valid? | pgregg's validate_email function  | rfc822 6345 chars  | arpad 71 chars  | Rejected 42 chars  | jome 13 chars  | Skiz 42 chars  | Lazesharp 160 chars  | Shadda 28 chars  | Shai-Tan 33 chars  | DaSourcerer 223 chars  | Slynderdale 72 chars  | cronus_ 46 chars  | asonge 256 chars  | php-filter_var function  | arpad2 140 chars  | NiteLiteW 120 chars  | asonge2 221 chars  | HM2K 4020 chars  | HM2K 2 96 chars  | arpad3 225 chars  | archtech 81 chars  | dev.to/devlorenzo 71 chars  | php-filter_validate_email 533 chars  | stevew 84 chars  | Jan Goyvaerts http://chris.602.org/temp/email_regex_preg.txt 6353 chars  | dominicsayers is_email function  | avataojs 150 chars  | powerni 21 chars  | 
| 'name.lastname@domain.com' | Y | Y | Y | Y | Y | Y | Y | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | 
| 'name+subaddr@domain.com' | Y | Y | Y | Y | Y | Y | Y | N * | N * | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N * | 
| '.@' | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| 'a@b' | N | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | N | N | N | Y * | N | N | Y * | N | N | Y * | 
| '@bar.com' | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| '@@bar.com' | N | N | N | N | N | Y * | N | N | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| 'a@bar.com' | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N * | Y | Y | Y | Y | 
| 'aaa.com' | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| 'aaa@.com' | N | N | N | N | N | N | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| 'aaa@.123' | N | N | N | N | N | N | N | N | N | N | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| 'aaa@[123.123.123.123]' | Y | Y | Y | Y | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | Y | Y | N * | Y | Y | N * | Y | N * | N * | Y | Y | Y | Y | Y | N * | 
| 'aaa@[123.123.123.123]a' | N | N | Y * | N | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | N | N | N | N | 
| 'aaa@[123.123.123.333]' | N | N | Y * | Y * | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | Y * | N | N | N | N | N | Y * | Y * | N | Y * | N | 
| 'a@bar.com.' | N | N | Y * | N | Y * | Y * | N | N | N | N | N | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| 'a@bar' | N | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | N | N | N | Y * | N | N | Y * | N | N | Y * | 
| 'a-b@bar.com' | Y | Y | Y | Y | Y | Y | Y | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | 
| '+@b.c' | N | N | Y * | N | N | Y * | N | N | N | N | N | N | N | N | Y * | N | N | N | Y * | N | N | N | Y * | Y * | N | Y * | Y * | N | N | 
| '+@b.com' | Y | Y | Y | Y | N * | Y | Y | N * | N * | N * | N * | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | N * | Y | Y | N * | Y | Y | Y | N * | 
| 'a@-b.com' | N | N | Y * | Y * | Y * | Y * | Y * | Y * | N | Y * | N | Y * | N | Y * | N | N | Y * | N | Y * | N | N | N | Y * | Y * | N | Y * | N | Y * | Y * | 
| 'a@b-.com' | N | N | Y * | Y * | Y * | Y * | Y * | Y * | N | Y * | N | Y * | N | Y * | N | N | Y * | N | Y * | Y * | N | Y * | Y * | Y * | N | Y * | N | Y * | Y * | 
| '-@..com' | N | N | N | N | Y * | Y * | N | Y * | N | N | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| '-@a..com' | N | N | Y * | N | Y * | Y * | N | Y * | N | Y * | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| 'a@b.co-foo.uk' | Y | Y | Y | Y | Y | Y | Y | N * | N * | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N * | Y | Y | N * | Y | Y | Y | Y | 
| '"hello my name is"@stutter.com' | Y | Y | Y | Y | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | Y | Y | N * | Y | N * | N * | Y | N * | Y | Y | Y | N * | 
| '"Test \"Fail\" Ing"@example.com' | Y | Y | Y | Y | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | Y | N * | Y | N * | N * | N * | N * | Y | Y | Y | N * | 
| 'valid@special.museum' | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | 
| 'invalid@special.museum-' | N | N | Y * | N | Y * | Y * | N | N | N | N | N | N | Y * | N | N | N | N | N | Y * | Y * | N | Y * | Y * | Y * | Y * | Y * | N | N | Y * | 
| 'shaitan@my-domain.thisisminekthx' | Y | Y | Y | N * | Y | Y | Y | N * | N * | N * | N * | N * | Y | N * | Y | N * | Y | N * | Y | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | 
| 'test@...........com' | N | N | N | N | Y * | Y * | N | Y * | N | Y * | N | Y * | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | Y * | 
| 'foobar@192.168.0.1' | N | N | Y * | N | N | Y * | N | N | N | N | N | Y * | Y * | Y * | N | N | N | N | Y * | N | N | N | Y * | Y * | Y * | Y * | N | N | Y * | 
| '"Abc\@def"@example.com' | Y | Y | Y | Y | N * | Y | N * | N * | N * | Y | N * | N * | N * | N * | Y | N * | N * | N * | Y | N * | Y | N * | N * | Y | N * | Y | Y | Y | N * | 
| '"Fred Bloggs"@example.com' | Y | Y | Y | Y | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | Y | Y | N * | Y | N * | N * | Y | N * | Y | Y | Y | N * | 
| '"Joe\Blow"@example.com' | Y | Y | Y | Y | N * | Y | Y | N * | N * | Y | N * | N * | N * | N * | Y | N * | N * | N * | Y | N * | Y | N * | N * | Y | N * | Y | Y | Y | N * | 
| '"Abc@def"@example.com' | Y | Y | Y | Y | N * | Y | N * | N * | N * | Y | N * | N * | N * | N * | Y | N * | N * | Y | Y | N * | Y | N * | N * | Y | N * | Y | Y | Y | N * | 
| 'customer/department=shipping@example.com' | Y | Y | Y | Y | Y | Y | Y | N * | N * | Y | Y | Y | Y | Y | Y | N * | Y | Y | Y | Y | Y | Y | Y | N * | N * | Y | Y | Y | N * | 
| '$A12345@example.com' | Y | Y | Y | Y | Y | Y | Y | N * | N * | Y | Y | Y | Y | Y | Y | N * | N * | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | N * | 
| '!def!xyz%abc@example.com' | Y | Y | Y | Y | Y | Y | Y | N * | N * | Y | Y | Y | Y | Y | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | N * | Y | Y | Y | N * | 
| '_somename@example.com' | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | 
| 'Test \ Folding \ Whitespace@example.com' | Y | Y | Y | Y | Y | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | 
| 'HM2Kinsists@(that comments are allowed)this.is.ok' | Y | Y | N * | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | N * | N * | Y | N * | N * | 
| 'user%uucp!path@somehost.edu' | Y | Y | Y | Y | Y | Y | Y | N * | N * | Y | N * | Y | Y | Y | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | N * | Y | Y | Y | N * | 
| 'user@domain.NORTHWESTERNMUTUAL' | Y | Y | Y | N * | Y | Y | N * | N * | Y | N * | N * | N * | Y | N * | Y | N * | N * | N * | Y | Y | N * | Y | Y | Y | Y | Y | Y | Y | Y | 
| 'punycode@domain.XN--VERMGENSBERATUNG-PWB' | Y | Y | Y | N * | Y | Y | N * | N * | N * | N * | N * | N * | Y | N * | Y | N * | N * | N * | Y | N * | N * | Y | Y | Y | Y | Y | Y | N * | Y | 
| 'cristian_likes_unscores@domain.com' | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | 
| 'cristian_underscore_in_domain@dom_ain.com' | N | N | Y * | N | Y * | Y * | N | Y * | Y * | Y * | N | Y * | Y * | N | N | N | N | N | Y * | N | N | N | N | N | N | Y * | N | N | Y * | 
| 'user@رسيل.السعودية' | Y | Y | Y | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | 
| '测试4@ua-test.世界' | Y | Y | Y | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | 
| '用户@例子.广告' | Y | Y | Y | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | 
| 'अजय@डाटा.भारत ' | Y | Y | Y | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | 
| 'квіточка@пошта.укр' | Y | Y | Y | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | 
| 'χρήστης@παράδειγμα.ελ' | Y | Y | Y | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | 
| 'Dörte@Sörensen.example.com' | Y | Y | Y | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | 
| 'коля@пример.рф' | Y | Y | Y | N * | N * | Y | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | N * | Y | N * | N * | N * | 
| Total differences | 0  | 13  | 15  | 25  | 14  | 20  | 34  | 29  | 24  | 24  | 28  | 21  | 23  | 14  | 21  | 22  | 15  | 19  | 20  | 11  | 21  | 24  | 17  | 26  | 11  | 10  | 14  | 40  | 
<?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 international
 * 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-2021
 * 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 international
 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',
    'rfc822'     =>  '#'.perl_rfc822().'#',
    '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',
    'dev.to/devlorenzo'         => '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/',
    'php-filter_validate_email' => "/^((\\\"[^\\\"\\f\\n\\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'          => '/(^(?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[ \\t])*))*\\>(?:(?:\\r\\n)?[ \\t])*))*)?;\\s*))\\z/',
    'dominicsayers <a href="http://www.dominicsayers.com/isemail/" ref="nofollow">is_email</a>'   => 'Function:is_email',
    'avataojs'   => '/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/',
    'powerni'    => '/^[-a-zA-Z0-9@\._]+$/',
);
/*
$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,
    'name+subaddr@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,
    'cristian_likes_unscores@domain.com'         => true,
    'cristian_underscore_in_domain@dom_ain.com'  => false,
    'user@رسيل.السعودية'                         => true, # https://whatis.techtarget.com/definition/email-address-internationalization-EAI#:~:text=Email%20address%20internationalization%20(EAI)%20is,when%20sending%20and%20receiving%20emails.
    '测试4@ua-test.世界'                          => true,
    '用户@例子.广告'                               => true, # (Chinese, Unicode)
    'अजय@डाटा.भारत   '                             => true, # (Hindi, Unicode)
    'квіточка@пошта.укр'                            => true, # (Ukrainian, Unicode)
    'χρήστης@παράδειγμα.ελ'                         => true, # (Greek, Unicode)
    'Dörte@Sörensen.example.com'                 => true, # (German, Unicode)
    'коля@пример.рф'                               => true, # (Russian, Unicode)
);
echo "<br />\nMatrix 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'
(?:(?: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\t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
 \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*
)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)
*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+
|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r
\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t
]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031
]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?
:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?
:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?
:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] 
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|
\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>
@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"
(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t]
)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?
:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[
\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-
\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(
?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;
:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([
^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\"
.\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\
]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()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?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[
\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t
])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t
])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?
:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|
\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:
[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\
]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)
?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["
()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)
?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>
@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[
 \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,
;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]
)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?
(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:
\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[
"()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])
*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\
.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(
?:\r\n)?[ \t])*))*)?;\s*)
EOWTF;
  return str_replace("\n", '', $rfc822);
}
echo '<font face="courier">';
show_source(__FILE__);