3 ms·
https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags https://stackoverflow.com/questions/1732348/regex-match-open.
by SPICLK2 11mo ago
https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags https://stackoverflow.com/questions/1732348/regex-match-open...
- croes 11mo agoThe accepted answer is one that doesn’t care about the questioner‘s use case and instead gives a pretty excessive "Don‘t do it"
- lukan 11mo agoIt does also give the right solution, using an xml parser.
- croes 11mo agoWe don’t know the use case. Maybe the questioner is also in full control of the HTML creation and they don’t need a parser for all possible HTML edge cases.
- SPICLK2 11mo agoMaybe they are, but they would also need to ensure a well-defined subset of HTML and also show that the subset is a reglar (Chomsky Type 3) grammar. It seems that even the very conceptually simple example given by the questioner is impossible.