It blows my mind that there is no simple regex to validate email.
There are websites for the sole purpose of offering a solution, like https://emailregex.com and threads upon threads on StackOverflow and forums of debates around the topic and still each website will randomly refuse valid emails or accept non valid ones.
@hugo I’m usually posting this in any thread discussing regexp to validate email addresses: https://davidcel.is/posts/stop-validating-email-addresses-with-regex/
Email regular expressions are the fastest way I've found to help new developers off the Dunning-Krueger hill when they start learning regexs. Seeing the number of cases you have to watch for expand, seemingly endlessly, helps people understand what they don't yet know.
The weird thing to me now isn't that email regexs don't work, it's that, somehow, email DOES work. Mostly. Kinda. Like all older computer systems, email protocols seem to be held together by duct tape and good intentions.
@nate True, if we attempted to explain how the DNS or Email protocol works to an extraterrestrial or one of our ancestrales they wouldn't believe this would ever work :)
Mastodon é uma rede social baseada em protocolos abertos da web e software livre e gratuito. É descentralizado como e-mail.