| ▲ | umanwizard 3 hours ago | ||||||||||||||||
Funny how differently people can perceive things. That's my least favorite SO answer of all time, and I cringe every time I see it. It's a very bad answer. First of all, processing HTML with regex can be perfectly acceptable depending on what you're trying to do. Yes, this doesn't include full-blown "parsing" of arbitrary HTML, but there are plenty of ways in which you might want to process or transform HTML that either don't require producing a parse tree, don't require perfect accuracy, or are operating on HTML whose structure is constrained and known in advance. Second, it doesn't even attempt to explain to OP why parsing arbitrary HTML with regex is impossible or poorly-advised. The OP didn't want his post to be taken over by someone hamming it up with an attempt at creative writing. He wanted a useful answer. Yes, this answer is "quirky" and "whimsical" and "fun" but I read those as euphemisms for "trying to conscript unwilling victims into your personal sense of nerd-humor". | |||||||||||||||||
| ▲ | chucksmash 2 hours ago | parent | next [-] | ||||||||||||||||
There's nothing that brings joy into this world quite like the guy waiting around to tell people he doesn't like the thing they like. | |||||||||||||||||
| ▲ | philistine 2 hours ago | parent | prev [-] | ||||||||||||||||
The whole argument hinges on one word in your post: arbitrary. I parse my own HTML I produce directly in a context where I fully control the output. It works fine, but parsing other people’s HTML is a lesson in humility. I’ve also done that, but I did it as a one time thing. I parsed a specific point in time, refusing to change that at any point. | |||||||||||||||||
| |||||||||||||||||