Regular Expressions Can Parse HTML (and More)
The true power of regular expressions (2012)
A 2012 deep dive argues that modern regex engines like PCRE are far more powerful than formal language theory suggests. By using recursive subpatterns and named groups, they can match context-free grammars—including HTML—and even transform BNF rules into working regexes. The author demonstrates this with an RFC 5322 email regex built directly from the grammar, proving that the common refrain "you can't parse HTML with regex" is misleading.
This statement - in the context of the question - is somewhere between very misleading and outright wrong.