4 ms·
Actually, if you read his rant all the way to the end he does offer a helpful suggestion: > Have you tried using an XML parser instead?
by armada651 6y ago
Actually, if you read his rant all the way to the end he does offer a helpful suggestion:
> Have you tried using an XML parser instead?
- andybak 6y agoExcept he's wrong in this case. The OP could use a regex in this specific scenario.
- chrismorgan 6y agoNot 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.
- andybak 6y agoYeah. 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.
- bhaak 6y ago> 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.
- chrismorgan 6y agoThis 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.