this post was submitted on 16 Nov 2024
716 points (99.4% liked)

Programmer Humor

19570 readers
1413 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 2 hours ago

Yeah, I'm just saying that the benefit of using such a regex isn't massive (unless you're building a service which can't send a mail).

a@b is a syntactically correct e-mail address. Most combinations of letters, an @-symbol and more letters will be syntactically correct, which is what most typos will look like. The regex will only catch fringe cases, such as a user accidentally hitting the spacebar.

And then, personally, I don't feel like it's worth pulling in one of those massive regexes (+ possibly a regex library) for most use-cases.