You can absolutely parse HTML with regex, so long as the document is finite in length. Every finite language is regular, hence can be parsed with regex's.
and you write your regex specifically for that document length, handling all possible nesting combinations. combinatoric explosion
Do a web search for the parent of your comment, read the Stackoverflow answer. It's a classic. Learn about Zalgo and Tony the pony, he comes.
Zalgo and situational subset parsing aside:
> You can absolutely parse HTML with regex, so long as the document is finite in length
This isn't sufficient, unless I'm misinterpreting what you're saying. It's not enough to have documents of finite length (all documents are finite in length), you need documents with a max length, so you have a finite number of possible documents to parse.