I wanted to find a regular expression to validate e-mail addresses, but when I searched I found dozens of slightly different versions of the same expression. Almost all of them had people leaving comments about how it failed to validate or invalidate some rare but completely valid/invalid address syntax. But dispite all the criticism, I couldn't find a definitive "best" expression. So, I setup arrays of some of the most promising expressions as well as a (hopefully) complete sampling of valid and invalid addresses. It's my philosophy that it's better to accept a few invalid addresses than reject any valid ones, so I'm shooting for 0 false-positives and as few false-negatives as possible.
Conclusion:
James Watts and Francisco Jose Martin Moreno are the first to develop one which passes all of the tests.
/^([\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
Arluison Guillaume has also improved Warren Gaebel's regex. This one will work in JavaScript:
/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i
Notes:
Results:
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | valid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | valid |
IPAndPort@127.0.0.1:25 | valid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | valid |
foor@bar.newTLD | valid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | invalid |
Valid: 19/19
Invalid: 18/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | valid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | valid |
IPAndPort@127.0.0.1:25 | valid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | valid |
foor@bar.newTLD | valid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 19/19
Invalid: 17/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | valid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | invalid |
IPAndPort@127.0.0.1:25 | invalid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | valid |
foor@bar.newTLD | valid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | valid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | invalid |
Valid: 17/19
Invalid: 17/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | valid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | valid |
IPAndPort@127.0.0.1:25 | valid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | valid |
foor@bar.newTLD | invalid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 18/19
Invalid: 17/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | valid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | valid |
IPAndPort@127.0.0.1:25 | valid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | valid |
foor@bar.newTLD | valid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | valid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 19/19
Invalid: 16/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | invalid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | valid |
IPAndPort@127.0.0.1:25 | valid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | invalid |
foor@bar.newTLD | invalid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 16/19
Invalid: 17/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | valid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | invalid |
uncommonTLD@domain.mobi | invalid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | valid |
IPAndPort@127.0.0.1:25 | valid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | invalid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | valid |
foor@bar.newTLD | invalid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 15/19
Invalid: 17/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | valid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | invalid |
IPAndPort@127.0.0.1:25 | valid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | invalid |
foor@bar.newTLD | valid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | valid |
invalid | |
someone-else@127.0.0.1.26 | valid |
.localStartsWithDot@domain.com | valid |
localEndsWithDot.@domain.com | valid |
two..consecutiveDots@domain.com | valid |
domainStartsWithDash@-domain.com | valid |
domainEndsWithDash@domain-.com | valid |
numbersInTLD@domain.c0m | valid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 17/19
Invalid: 9/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | invalid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | invalid |
IPAndPort@127.0.0.1:25 | invalid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | invalid |
foor@bar.newTLD | valid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | valid |
.localStartsWithDot@domain.com | valid |
localEndsWithDot.@domain.com | valid |
two..consecutiveDots@domain.com | valid |
domainStartsWithDash@-domain.com | valid |
domainEndsWithDash@domain-.com | valid |
numbersInTLD@domain.c0m | valid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 15/19
Invalid: 10/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | invalid |
uncommonTLD@domain.museum | invalid |
uncommonTLD@domain.travel | invalid |
uncommonTLD@domain.mobi | invalid |
countryCodeTLD@domain.uk | invalid |
countryCodeTLD@domain.rw | invalid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | invalid |
IPAndPort@127.0.0.1:25 | invalid |
subdomain@sub.domain.com | invalid |
local@dash-inDomain.com | invalid |
dot.inLocal@foo.com | invalid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | invalid |
foor@bar.newTLD | invalid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 6/19
Invalid: 17/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | invalid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | invalid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | invalid |
IPAndPort@127.0.0.1:25 | invalid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | invalid |
singleLetterDomain@x.org | invalid |
&*=?^+{}'~@validCharsInLocal.net | invalid |
foor@bar.newTLD | invalid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | invalid |
localEndsWithDot.@domain.com | invalid |
two..consecutiveDots@domain.com | invalid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 11/19
Invalid: 17/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | invalid |
uncommonTLD@domain.museum | invalid |
uncommonTLD@domain.travel | invalid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | invalid |
IPAndPort@127.0.0.1:25 | invalid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | valid |
&*=?^+{}'~@validCharsInLocal.net | invalid |
foor@bar.newTLD | invalid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | valid |
localEndsWithDot.@domain.com | valid |
two..consecutiveDots@domain.com | valid |
domainStartsWithDash@-domain.com | valid |
domainEndsWithDash@domain-.com | valid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 12/19
Invalid: 12/18
These should be valid | |
l3tt3rsAndNumb3rs@domain.com | valid |
has-dash@domain.com | valid |
hasApostrophe.o'leary@domain.org | invalid |
uncommonTLD@domain.museum | valid |
uncommonTLD@domain.travel | valid |
uncommonTLD@domain.mobi | valid |
countryCodeTLD@domain.uk | valid |
countryCodeTLD@domain.rw | valid |
lettersInDomain@911.com | valid |
underscore_inLocal@domain.net | valid |
IPInsteadOfDomain@127.0.0.1 | invalid |
IPAndPort@127.0.0.1:25 | invalid |
subdomain@sub.domain.com | valid |
local@dash-inDomain.com | valid |
dot.inLocal@foo.com | valid |
a@singleLetterLocal.org | valid |
singleLetterDomain@x.org | invalid |
&*=?^+{}'~@validCharsInLocal.net | invalid |
foor@bar.newTLD | valid |
These should be invalid | |
missingDomain@.com | invalid |
@missingLocal.org | invalid |
missingatSign.net | invalid |
missingDot@com | invalid |
two@@signs.com | invalid |
colonButNoPort@127.0.0.1: | invalid |
invalid | |
someone-else@127.0.0.1.26 | invalid |
.localStartsWithDot@domain.com | valid |
localEndsWithDot.@domain.com | valid |
two..consecutiveDots@domain.com | valid |
domainStartsWithDash@-domain.com | invalid |
domainEndsWithDash@domain-.com | invalid |
numbersInTLD@domain.c0m | invalid |
missingTLD@domain. | invalid |
! "#$%(),/;<>[]`|@invalidCharsInLocal.org | invalid |
invalidCharsInDomain@! "#$%(),/;<>_[]`|.org | invalid |
local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org | valid |
Valid: 14/19
Invalid: 14/18