2 ms·
The answer is relevant, it answers the question and it is also famous. I don't know what are you talking about.
by edem 9y ago
The answer is relevant, it answers the question and it is also famous. I don't know what are you talking about.
- chillacy 9y agoIt's famous, funny, and a classic, but the original SO question was about "matching open html tags" with a regex while the answer was about "parsing [X]HTML" with a regex. So the poster made some assumptions about what the original question's author was intending to do. Ultimately the choice between which tool to pick is a tradeoff that has to be made by the author, as hinted in the (much better) second answer: https://stackoverflow.com/a/1733489 https://stackoverflow.com/a/1733489
- marcosdumay 9y agoJust to add to chillacy's answer, regular expression are a perfectly valid and reasonable tool to do what I understand the question author wanted to do. His proposal was buggy (he misses a single situation), and I would use something more than pure regexes myself, but it's perfectly reasonable to use them to detect opening HTML tags.