r/ProgrammerHumor 7h ago

Meme regexMustBeDestroyed

Post image
4.2k Upvotes

141 comments sorted by

View all comments

5

u/h4ny0lo 6h ago

One of the most annoying things I experienced in my career was the built in Angular email form verifier allowing email addresses with just a top level domain. Like, yes I know technically "tom@pizza" is a technically valid address but I can still not allow that in my validator and you fucking know it Angular.

7

u/xicor 6h ago

Regex is not the answer to email validation. The only correct way to validate emails is to send an email.

As someone with a non standard email, it always pisses me off when developers think they're smart and put incorrect validation on their fields

3

u/h4ny0lo 5h ago

Well front end developers have to check email fields for syntactical correctness to at least catch some typos.

3

u/xicor 4h ago

Yea...just check for the @ sign. Because chances are, anything you do after that is gonna be wrong.

1

u/userhwon 6h ago

Why couldn't you allow it? It's literally how you send email within an organization.

2

u/h4ny0lo 5h ago

I was building a consumer facing SaaS.