me: i need to validate some email addresses, so i am going to write a quick regex. how hard can it be?

*4 hours later*
me. i now have 2 problems and one of them is that I've accidentally summoned an ancient daemon. wht the actual fuck

@nixCraft Either you use something simple like .*@.*\..* (at least an at-sign and a dot after it) and send an e-mail with an link or you will summon a debate war on if the complete e-mail standards should be followed or not.

And, if you choose to follow the standards, I have to warn you (and I guess some people had warned you already) that most e-mail servers do not follow the standard (like Cloudflare).

On the other hand, I just sent a message from "example+';DROP/**/TABLE/**/users;#"@gmail.com to example@some-domain-of-mine and it arrived. I hope you never need to deal with addresses like those.

@qgustavor @nixCraft you have successfully summoned a debate war by forgetting that user@localhost is a valid email, so is user@::1, and any other locally resolved name and ipv6 address. Just containing a @ is more than enough if you already try to send an email to it. ;)

Seriously though, enforcing a dot in the domain is probably reasonable for most publicly accessible email servers.
@kawazoe @nixCraft I got my share of self-hosted things that don't allow using localhost as the domain (e.g. Pocketbase). ::1 I guess it's invalid, it should be user@[::1]. I have a sending email address that works (sometimes) with four at-signs.