Skip to content

Email validation does not work correctly #34602

Answered by coliff
chusmsanchez asked this question in General
Discussion options

You must be logged in to vote

Email validation uses the browsers built-in validation regex RFC 5322/5952 which allows for every single possible valid email address. There are some TLDs or valid email addresses that you might know exist.

You could include your own Regex though - here's one that works with (approx) 99.99% of addresses:
https://www.emailregex.com/

If you want to validate that the TLD is valid, I made a simple HTML5 pattern a few years ago (using no JavaScript!) which validates against a list of valid TLDs which you might find helpful. See code and demo here: https://github.com/coliff/html5-email-regex

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@chusmsanchez
Comment options

Answer selected by ffoodd
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants