News for hackers. Stuff that matters.
Re:You can't parse [X]HTML with regex (2009) by chrismorgan on Friday March 05, 2021 @07:31AM (#26356102)
Not true. The questioner has not provided anywhere near enough detail to determine if regular expressions are sufficient. For example: should <br> match, or not? Its semantics are identical to <br />. To determine if regular expressions are enough, you would need to know exactly what markup you’re dealing with, and that has not been provided.
Re:You can't parse [X]HTML with regex (2009) by andybak on Friday March 05, 2021 @07:43AM (#26356213)
Yeah. I guess in other parts of this discussion I'm arguing for always probing hidden assumptions and missing background whilst here I'm saying "let's interpret the question in the most charitable way possible".

Plus - Stack Overflow is about trying to generalize any given question to maximize it's wider usefulness.

Re:You can't parse [X]HTML with regex (2009) by bhaak on Friday March 05, 2021 @10:00AM (#26357518)
> Plus - Stack Overflow is about trying to generalize any given question to maximize it's wider usefulness.

Since when? You don't get extra points if you write stuff that doesn't concern OP's problem. Most SO problems don't get viral and get lots of upvotes from other people. From a game theory perspective, it doesn't make sense to add more to an answer than to make it the accepted one.

If you have slightly different constraints you are encouraged to open another question. Discussions are frowned upon and sometimes even interrupted by admins so you can't discuss if your situation is different from OP's situation and so could warrant a different answer.

Re:You can't parse [X]HTML with regex (2009) by chrismorgan on Friday March 05, 2021 @10:43AM (#26358062)
This has always been the intent of Stack Overflow, from its very earliest days. One of the stock reasons for closing a question used to be “too specific—this question is unlikely to help anyone else” (or words to that effect), though that has been removed now (I think because it upset too many people who took its blunt message the wrong way). People have always been nudged towards adjusting questions so that they’ll be generally useful.

Discussions on questions are routinely about unrelated or not-closely-related matters, and quite apart from that Stack Overflow wants to be a Q&A platform, not a discussion platform.