Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isEmail feature #2524

Open
AkaeyesWanabe opened this issue Feb 3, 2025 · 4 comments
Open

isEmail feature #2524

AkaeyesWanabe opened this issue Feb 3, 2025 · 4 comments
Labels

Comments

@AkaeyesWanabe
Copy link

Results-of-ValidatorJS.pdf

There is a problem in validation of some email addresses

You can see the joined document. it's a test of your isEmail validation script.

@WikiRik
Copy link
Member

WikiRik commented Feb 3, 2025

Could you share the text contents of the PDF in this file? Or as image?
Due to security concerns I'd rather not open random PDFs

@AkaeyesWanabe
Copy link
Author

AkaeyesWanabe commented Feb 4, 2025

OK i see. Sorry for the late.

Image
Image
Image
Image

@AkaeyesWanabe
Copy link
Author

this is emails addresses list (You can try yourself):

-- invalid addresses from Wikipedia resource
invalid
#, 011, [email protected], new-long, Long ASCII
abc.example.com
#, 012, [email protected], new-long, Long ASCII
a@b@[email protected]
#, 013, [email protected], new-long, Long ASCII
a"b(c)d,e:f;gi[j\k][email protected]
#, 014, [email protected], new-long, Long ASCII
just"not"[email protected]
#, 015, [email protected], new-long, Long ASCII
this is"not\[email protected]
#, 016, [email protected], new-long, Long ASCII
this\ still"not\[email protected]
#, 017, [email protected], new-long, Long ASCII
1234567890123456789012345678901234567890123456789012345678901234+x@example.com
#, 018, [email protected], new-long, Long ASCII
i.like.underscores@but_they_are_not_allowed_in_this_part

-- valid addresses from Wikipedia resource
valid
#, 200, [email protected], new-long, Long ASCII
[email protected]
#, 201, [email protected], new-long, Long ASCII
[email protected]
#, 202, [email protected], new-long, Long ASCII
[email protected]
#, 203, [email protected], new-long, Long ASCII
[email protected]
#, 204, [email protected], new-long, Long ASCII
name/[email protected]
#, 205, [email protected], new-long, Long ASCII
admin@example
#, 206, [email protected], new-long, Long ASCII
[email protected]
#, 207, [email protected], new-long, Long ASCII
" "@example.org
#, 208, [email protected], new-long, Long ASCII
"john..doe"@example.org
#, 209, [email protected], new-long, Long ASCII
mailhost![email protected]
#, 210, [email protected], new-long, Long ASCII
"very.(),:;<>[]".VERY."very@\ "very".unusual"@strange.example.com
#, 211, [email protected], new-long, Long ASCII
user%[email protected]
#, 212, [email protected], new-long, Long ASCII
[email protected]
#, 213, [email protected], new-long, Long ASCII
postmaster@[123.123.123.123]
#, 214, [email protected], new-long, Long ASCII
postmaster@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370:7334]
#, 215, [email protected], new-long, Long ASCII
_test@[IPv6:2001:0db8:85a3:0000:0000:8a2e:0370:7334]

-- validated addresses from the UASG resource with corresponding index as id
valid
#, 32, [email protected], new-long, Long ASCII
[email protected]
#, 33, [email protected], new-short, Short ASCII
[email protected]
#, 34, [email protected], RTL, Arabic
تجربة-بريد-الكتروني@تجربة-القبول-الشامل.موريتانيا
#, 35, [email protected], , Armenian
Էլփոստ-թեստ@համընդհանուր-ընկալում-թեստ.հայ
#, 36, [email protected], , Bengali Bangla
ই-মেইল-পরীক্ষা@সর্বজনীন-স্বীকৃতির-পরীক্ষা.ভারত
#, 37, [email protected], , Cyrillic
почта-тест@универсальное-принятие-тест.москва
#, 38, [email protected], , Devanagari
ईमेल-परीक्षण@सार्वभौमिक-स्वीकृति-परीक्षण.संगठन
#, 39, [email protected], , Georgian
ფოსტის-ტესტი@უნივერსალური-თავსობადობის-ტესტი.გე
#, 40, [email protected], , Greek
ηλεκτρονικό-μήνυμα-δοκιμή@καθολική-αποδοχή-δοκιμή.ευ
#, 41, [email protected], , Gujarati
ઇમેઇલ-પરીક્ષણ@સાર્વત્રિક-સ્વીકૃતિ-પરીક્ષણ.ભારત
#, 42, [email protected], , Gurmukhi
ਈਮੇਲ-ਪਰਖ@ਸਰਵਵਿਆਪਕ-ਪ੍ਰਵਾਨਗੀ-ਪਰਖ.ਭਾਰਤ
#, 43, [email protected], , Hangul
이메일테스트@다국어도메인이용환경테스트.한국
#, 44, [email protected], RTL, Hebrew
מבחן-דואר-אלקטרוני@מבחן-קבלה-אוניברסלי.קום
#, 45, [email protected], , Hiragana
めーるてすと@どこでもつかえる.みんな
#, 46, [email protected], , Kannada
ಇ-ಅಂಚೆ-ಪರೀಕ್ಷೆ@ಸಾರ್ವತ್ರಿಕ-ಸ್ವೀಕಾರಾರ್ಹತೆ-ಪರೀಕ್ಷೆ.ಭಾರತ
#, 47, [email protected], , Katakana
メールテスト@ユニバーサルアクセプタンス.クラウド
#, 48, [email protected], , Lao
ອີເມວ-ທົດລອງ@ສາກົນ-ການຍອມຮັບ-ທົດລອງ.ລາວ
#, 49, [email protected], , Latin
[email protected]ögensberatung
#, 50, [email protected], , Malayalam
ഇമെയിൽ-പരിശോധന@സാർവത്രിക-സ്വീകാര്യതാ-പരിശോധന.ഭാരതം
#, 51, [email protected], , Oriya
ଇମେଇଲ-ଟେଷ୍ଟ@ଯୁନିଭରସାଲ-ଏକସେପ୍ଟନ୍ସ-ଟେଷ୍ଟ.ଭାରତ
#, 52, [email protected], , Sinhala
ඉ-තැපැල්-පිරික්සුම@විශ්ව-සම්මුති-පිරික්සුම.ලංකා
#, 53, [email protected], , Tamil
மின்னஞ்சல்-சோதனை@பொது-ஏற்பு-சோதனை.சிங்கப்பூர்
#, 54, [email protected], , Telugu
ఇమెయిల్-పరీక్ష@యూనివర్సల్-ఆమోదం-పరీక్ష.భారత్
#, 55, [email protected], , Thai
อีเมลทดสอบ@ยูเอทดสอบ.ไทย
#, 56, [email protected], , Simplified Chinese
电子邮件测试@普遍适用测试.我爱你
#, 57, [email protected], , Traditional Chinese
電子郵件測試@普遍適用測試.台灣
#, 58, [email protected], , Ethiopic
ኢሜይል-ሙከራ@ሁለንአቀፍ-ተቀባይነት-ሙከራ.com
#, 59, [email protected], , Khmer
សារអេឡិកត្រូនិកសាកល្បង@ការសាកល្បងទទួលយកជាអន្តរជាតិ.com
#, 60, [email protected], , Myanmar
အီးမေးလ်စမ်းသပ်ချက်@အလုံးစုံလက်ခံမှုစမ်းသပ်ချက်.com
#, 61, [email protected], RTL, Thaana
އީމޭލު-ޓެސްޓު@ދުނިޔެ-ގަބޫލުކުރާ-ޓެސްޓު.com
#, 62, [email protected], , Tibetan
གློག་འཕྲིན་བརྟག་དཔྱད@ཡོངས་ཁྱབ་ངོས་ལེན་བརྟག་དཔྱད.com
#, 73, [email protected], RTL, Hebrew
email-test@universal-acceptance-test.קום
#, 74, [email protected], , Latin
email-épreuve@épreuve-acceptation-universelle.org
#, 75, [email protected], mailbox using uppercase letters, Latin
Email-Épreuve@épreuve-acceptation-universelle.org
#, 76, [email protected], domain in non-NFC normalization form, Latin
email-épreuve@épreuve-acceptation-universelle.org
#, 77, [email protected], mailbox in non-NFC normalization form, Latin
email-épreuve@épreuve-acceptation-universelle.org
#, 78, [email protected], Ideographic Full Stop, Simplified Chinese
电子邮件测试@普遍适用测试。我爱你
#, 79, [email protected], RTL; A-label.U-label, Arabic
تجربة-بريد-الكتروني@xn-----ctdbabcfhu9c2b9l1acccr4c.موريتانيا
#, 80, [email protected], RTL; U-label.A-label, Arabic
تجربة-بريد-الكتروني@تجربة-القبول-الشامل.xn--mgbah1a3hjkrd
#, 81, [email protected], RTL; A-label.A-label, Arabic
تجربة-بريد-الكتروني@xn-----ctdbabcfhu9c2b9l1acccr4c.xn--mgbah1a3hjkrd
#, 82, [email protected], RTL; A-label.A-label, Arabic
[email protected]

@AkaeyesWanabe
Copy link
Author

I can found a good regex for utf8 user email checking and quoted user email checking you can try these.

const emailUserUtf8Part = /^(?!\d)(?!...)[a-z\d!#$&'+-/=?^_`{|}~%.\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/iu;

const quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/iu;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants