Comment by marcosdumay
Comment by marcosdumay 8 hours ago
HTML comments do not nest. The obvious tokenizer you can create with regular expressions is the correct one.
Comment by marcosdumay 8 hours ago
HTML comments do not nest. The obvious tokenizer you can create with regular expressions is the correct one.
If you are talking about detecting tags, you (and the person asking that SO question) is talking about tokenization, and everybody (like the one making that famous answer) bringing parsing into the discussion is just being an asshole.
If you're talking about tokenizers, then you're no longer parsing HTML with a regex. You're tokenizing it with a regex and processing it with an actual parser.