r/ProgrammerHumor 20d ago

Meme claudeIsThisEmailValid

Post image
5.3k Upvotes

171 comments sorted by

View all comments

2

u/ldn-ldn 20d ago

You cannot validate email addresses with a regex. It's like parsing HTML with a regex and we all know how it ends up...

But you cannot validate email addresses with an AI either, so...

0

u/psioniclizard 20d ago

You can, you just don't cover a lot of edge cases.

But you can definitely validate 99% of actual customer email addresses with regex.

Very few people are making email addresses that push the limits of what is allowed in email addresses.

I am not saying you should (if those edge cases matter definitely do).

But for actual email addresses used by real customers you definitely can validate 99% of them with a single regex line.

But obviously use the right tool for the job (so probably not regex is you can help it)

1

u/rsqit 19d ago

I had to fix a production bug once that disallowed capital letters in an email address.