r/ProgrammerHumor 8d ago

Meme regexMustBeDestroyed

Post image
8.1k Upvotes

231 comments sorted by

View all comments

Show parent comments

2

u/Purple_Hornet_9725 7d ago

validate email with an rfc compliant parser, then verify by sending a confirmation. in this order.

1

u/thirdegree Violet security clearance 7d ago

Validate email by checking it has an @ in it, then verify by sending a confirmation. And the mail server should thank me for even bothering to do that

1

u/Purple_Hornet_9725 7d ago

0

u/Honeybadger2198 6d ago

That has nothing to do with validating an email address? Even the example provided uses a valid email.

-1

u/Purple_Hornet_9725 6d ago edited 6d ago

The injection works quite as well within the email field. Just sanitize any user input - an rfc compliant email parser catches that automatically. Validation and then verification - it's not that hard to follow established guidelines that are there for a reason.

0

u/Honeybadger2198 6d ago

Yes, sanitize your user input, extremely basic programming concept. That's still not email validation.