Skip to content

Instantly share code, notes, and snippets.

@noncent
Created June 29, 2020 06:54
Show Gist options
  • Save noncent/898f91f2c43a99e3eff55df6359cfdef to your computer and use it in GitHub Desktop.
Save noncent/898f91f2c43a99e3eff55df6359cfdef to your computer and use it in GitHub Desktop.
List of valid and invalid emails to check
!def!xyz%[email protected]
"""@iana.org
""@iana.org
"[[ test ]]"@iana.org
"\"@iana.org
"Abc@def"@iana.org
"Abc\@def"@iana.org
"Austin@Powers"@iana.org
"Doug "Ace" L."@iana.org
"Doug \"Ace\" L."@iana.org
"email"@example.com
"first"."last"@iana.org
"first"."middle"."last"@iana.org
"first"[email protected]
"first".middle."last"@iana.org
"first"last"@iana.org
"first(last)"@iana.org
"first..last"@iana.org
"first.middle"."last"@iana.org
"first.middle.last"@iana.org
"first@last"@iana.org
"first\"last"@iana.org
"first\\"last"@iana.org
"first\\\"last"@iana.org
"first\\last"@iana.org
"first\last"@iana.org
"foo"(yay)@(hoopla)[1.2.3.4]
"Fred Bloggs"@iana.org
"Fred\ Bloggs"@iana.org
"hello my name is"@stutter.com
"Ima Fool"@iana.org
"Ima.Fool"@iana.org
"Joe.\\Blow"@iana.org
"Joe\\Blow"@iana.org
"[email protected]
"test"blah"@iana.org
"test"test"@iana.org
"test
 blah"@iana.org
"test
blah"@iana.org
"Test \"Fail\" Ing"@iana.org
"test.test"@iana.org
"test@test"@iana.org
"test\"blah"@iana.org
"test\
 blah"@iana.org
"test\
blah"@iana.org
"test\\blah"@iana.org
"test\blah"@iana.org
"test\test"@iana.org
"Unicode NULL \␀"@char.com
"Unicode NULL ␀"@char.com
#@%^%#$@#$@#.com
[email protected]
 
 (
 x 
 ) 
&#10
()[]\;:,><@iana.org
(foo)cal(bar)@(baz)iamcal.com(quux)
[email protected]
[email protected]
[email protected]
[email protected]
-- test [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
.@
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
1234   @   local(blah)  .machine .example
12345678901234567890123456789012345678901234567890123456789012345@iana.org
1234567890123456789012345678901234567890123456789012345678901234@iana.org
123456789012345678901234567890123456789012345678901234567890@12345678901234567890123456789012345678901234567890123456789.123456
1234567890123456789012345678901234567890123456789012345678@12345678901234567890123456789012345678901234567890123456789.12345678
[email protected]
[email protected]
[email protected]
[email protected]
@@bar.com
@bar.com
@[email protected]
@[email protected]
@[email protected]
@example.com
@iana.org
@NotAnEmail
[test]@iana.org
[email protected]
[email protected]
[email protected]
[email protected]
_ishould
[email protected]
[email protected]
[email protected]
a(a(b(c)d(e(f))g)(h(i)j)@iana.org
a(a(b(c)d(e(f))g)h(i)j)@iana.org
[email protected]
[email protected]
a@b
[email protected]
[email protected]
a@bar
[email protected]
[email protected].
aaa.com
[email protected]
[email protected]
aaa@[123.123.123.123]
aaa@[123.123.123.123]a
aaa@[123.123.123.333]
[email protected]
abc@[email protected]
abc\@[email protected]
Abc\@[email protected]
abc\@iana.org
abc\\@[email protected]
abc\\@iana.org
[email protected]
[email protected]
c@(Chris's host.)public.example
cal(foo(bar)@iamcal.com
cal(foo)bar)@iamcal.com
cal(foo\)@iamcal.com
cal(foo\)bar)@iamcal.com
cal(foo\@bar)@iamcal.com
cal(woo(yay)hoopla)@iamcal.com
cal@iamcal(woo).(yay)com
cdburgess+!#$%&'*-/=?+_{}|[email protected]
customer/[email protected]
customer/[email protected]
[email protected]
[email protected]
doug@
Doug\ \"Ace\"\ L\[email protected]
Doug\ \"Ace\"\ [email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
email.example.com
[email protected]
[email protected]
[email protected]
email@[123.123.123.123]
email@ex ample.co.jp
email@example
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected] (Joe Smith)
[email protected]
[email protected]
[email protected]
email@[email protected]
[email protected]
[email protected]
first()[email protected]
first(1234567890123456789012345678901234567890123456789
first(a"bc.def)[email protected]
first(abc("def".ghi).mno)middle(abc("def".ghi).mno).last@(abc("def".ghi).mno)example(abc("def".ghi).mno).(abc
first(abc.def)[email protected]
first(abc\(def)@iana.org
first(middle)[email protected]
first(Welcome to
 the ("wonderful" (!)) world
 o
first.""[email protected]
first."last"@iana.org
first."mid\dle"."last"@iana.org
first.(")middle.last(")@iana.org
first.(
 middle
 )[email protected]
[email protected]
first.last
first.last @iana.org
[email protected]
first.last@
[email protected]
[email protected]
[email protected]
first.last@[.12.34.56.78]
first.last@[12.34.56.789]
first.last@[12.34.56.78]
first.last@[::12.34.56.78]
first.last@[IPv5:::12.34.56.78]
first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.44]
first.last@[IPv6:0123:4567:89ab:CDEF::11.22.33.44]
first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.xx]
first.last@[IPv6:0123:4567:89ab:cdef::]
first.last@[IPv6:0123:4567:89ab:CDEF::]
first.last@[IPv6:0123:4567:89ab:CDEFF::11.22.33.44]
first.last@[IPv6:1111:2222:33333::4444:5555]
first.last@[IPv6:1111:2222:3333:4444:5555:12.34.56.78]
first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.56.78]
first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.567.89]
first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:12.34.56.78]
first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888:9999]
first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888]
first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777]
first.last@[IPv6:1111:2222:3333:4444:5555:6666::]
first.last@[IPv6:1111:2222:3333::4444:12.34.56.78]
first.last@[IPv6:1111:2222:3333::4444:5555:12.34.56.78]
first.last@[IPv6:1111:2222:3333::4444:5555:6666:7777]
first.last@[IPv6:1111:2222:3333::4444:5555:6666]
first.last@[IPv6:1111:2222:333x::4444:5555]
first.last@[IPv6:1111:2222::3333::4444:5555:6666]
first.last@[IPv6::11.22.33.44]
first.last@[IPv6:::1111:2222:3333:4444:5555:6666]
first.last@[IPv6:::12.34.56.78]
first.last@[IPv6::::11.22.33.44]
first.last@[IPv6::::]
first.last@[IPv6::::b3:b4]
first.last@[IPv6::::b4]
first.last@[IPv6:::]
first.last@[IPv6:::a2:a3:a4:b1:b2:b3:b4]
first.last@[IPv6:::a2:a3:a4:b1:ffff:11.22.33.44]
first.last@[IPv6:::a3:a4:b1:ffff:11.22.33.44]
first.last@[IPv6:::b3:b4]
first.last@[IPv6:::b4]
first.last@[IPv6::]
first.last@[IPv6::a2::b4]
first.last@[IPv6::a2:a3:a4:b1:b2:b3:b4]
first.last@[IPv6::b3:b4]
first.last@[IPv6::b4]
first.last@[IPv6:a1:11.22.33.44]
first.last@[IPv6:a1::11.22.33.44.55]
first.last@[IPv6:a1::11.22.33.44]
first.last@[IPv6:a1::11.22.33]
first.last@[IPv6:a1:::11.22.33.44]
first.last@[IPv6:a1:::]
first.last@[IPv6:a1:::b4]
first.last@[IPv6:a1::]
first.last@[IPv6:a1::a4:b1::b4:11.22.33.44]
first.last@[IPv6:a1::b211.22.33.44]
first.last@[IPv6:a1::b2:11.22.33.44]
first.last@[IPv6:a1::b2::11.22.33.44]
first.last@[IPv6:a1::b3:]
first.last@[IPv6:a1::b4]
first.last@[IPv6:a1:]
first.last@[IPv6:a1:a2::11.22.33.44]
first.last@[IPv6:a1:a2:::11.22.33.44]
first.last@[IPv6:a1:a2:::]
first.last@[IPv6:a1:a2::]
first.last@[IPv6:a1:a2:]
first.last@[IPv6:a1:a2:a3:a4::11.22.33.44]
first.last@[IPv6:a1:a2:a3:a4::b1:b2:b3:b4]
first.last@[IPv6:a1:a2:a3:a4:b1::11.22.33.44]
first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3::]
first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3:]
first.last@com
[email protected]
[email protected]
[email protected]
[email protected],com
first.last@x(1234567890123456789012345678901234567890123456789012345678901234567890).com
first.last@x23456789012345678901234567890123456789012345678901234567890123.iana.org
first.last@x234567890123456789012345678901234567890123456789012345678901234.iana.org
first\@[email protected]
first\\@[email protected]
first\[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]@wfwf
foo@[\1.2.3.4]
[email protected]
Fred\ [email protected]
[email protected]
[email protected].
hello [email protected]
[email protected]
HM2Kinsists@(that comments are allowed)this.is.ok
[email protected]
[email protected]
[email protected]
Ima [email protected]
[email protected]
Invalid \
 Folding \
 [email protected]
[email protected]
jdoe@machine(comment).  example
Joe Smith <[email protected]>
Joe.\\[email protected]
meinkej@__yahoo.__com
meinkej@__yahoo.com
[email protected]
meinkej______@__yahoo.__com
[email protected]
[email protected]
[email protected]
[email protected]
NotAnEmail
ote"@iana.org
pete(his&nbsp;account)@silly.test(his&nbsp;host)
[email protected]
phil.h\@\@[email protected]
plainaddress
[email protected]
[email protected]
[email protected]
t*[email protected]
[email protected]
[email protected]
test."test"@iana.org
test.&amp;#13;&amp;#10;&amp;#13;&amp;#10;&nbsp;[email protected]
Test.&amp;#13;&amp;#10;&nbsp;Folding.&amp;#13;&amp;#10;&nbsp;[email protected]
test.&nbsp;&amp;#13;&amp;#10;&nbsp;&amp;#13;&amp;#10;&nbsp;[email protected]
[email protected]
[email protected]
test.iana.org
[email protected]
test@.
[email protected]
[email protected]
[email protected]
[email protected]]
[email protected]
test@12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
test@@iana.org
test@[123.123.123.123
test@[123.123.123.123]
test@Bücher.ch
test@example
test@example.
[email protected]&amp;#10;
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
test@[email protected]
[email protected]
[email protected]
[email protected]_email.com
[email protected]
[email protected]
Unicode&nbsp;NULL&nbsp;\␀@char.com
user%[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x2345678
[email protected]
[email protected]
[email protected]
{^c\@**Dog^}@cartoon.com
{_test_}@iana.org
[email protected]
منیش@بھارت.اشوک
نتن@بھارت.اشوک
پریانکا@بھارت.اشوک
یک@بھارت.اشوک
राहुल.सिंह@google.com
राहुल@rediffmail.com
একটি@অশোকা.ভারত
নিতিন@অশোকা.ভারত
প্রিয়াঙ্কা@অশোকা.ভারত
মধুর@অশোকা.ভারত
あいうえお@example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment