3 ms·
I like the HTML spec’s version, used for <input type=email> validation: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address https://html.spec
by chrismorgan 5y ago
I like the HTML spec’s version, used for <input type=email> validation: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address https://html.spec.whatwg.org/multipage/input.html#valid-e-ma.... It allows all realistic inputs except for IP addresses (of dubious realism) and email address internationalisation (internationalised domain names are supported, but the local part is still currently stuck with ASCII, which is in keeping with its still-quite-limited support, though https://github.com/whatwg/html/issues/4562 https://github.com/whatwg/html/issues/4562 progresses in fits and starts).
- bluefirebrand 5y agoThat's a good approach honestly. I tend to just check for an @ and call it a day, validate it by emailing it and giving them a link to click if I need them to. It's really the only way to ensure it's a valid and active address. People just don't want to build it.