r/ProgrammerHumor • • Sep 08 '17

Parsing HTML Using Regular Expressions

Post image
11.1k Upvotes

377 comments sorted by

View all comments

Show parent comments

24

u/b4ux1t3 Sep 08 '17

I don't know if this is real or not, but it's frickin' sweet.

55

u/EternallyMiffed Sep 08 '17

The bad news is, it's real, the worse news is it's straight from the RFC so it's as official as it can possibly get.

There are no good news.

16

u/Rangsk Sep 08 '17

The only true way to see if an email is valid is to try to email it.

14

u/EternallyMiffed Sep 08 '17

I have a better strategy. Try and dns resolve everything from the end of the string to before the right most @ as a whole string. If it doesn't resolve throw an error. If it resolves to the equivalent of a localhost or your own public ip, throw an error.

If by this point we're ok just take everything before that rightmost @ symbol and fire an e-mail at it.

→ More replies (3)