There are many regexes which can be used to validate email address, but most of them aren’t compatible with non-ASCII characters. Once an email address contains non-ASCII characters like ‘Rδοκιμή@παράδειγμα.δοκιμή’ or ‘管理员@中国互联网络信息中心.中国’, they can’t recognize it correctly. How to construct a regex which is used to validate email address and compatible with non-ASCII characters?
Share
Don’t overcomplicate things, please.
Take a moment and think about why you need that. Most likely because you want to send your user an email, right? So I’d advocate for the easiest email validation regex there is:
Done. It will validate all valid email addresses. It will also incorrectly validate a lot of stuff that just looks like one but isn’t actually valid, but most errors are either not filling out a form field or confusing fields and entering the wrong things in other fields.
Also you’ll notice if an email address isn’t valid because your mails bounce. And existence of an address is something no regex can ever do for you.