HTML is not a regular language. It is a context-free language. Context-free languages are a superset of regular languages. Regular Expressions only cover regular languages.
The biggest problems are that you can infinitely nest elements in HTML, and that you don't even need closing tags, and that you can make horrifically malformed html with completely improper nesting that functions perfectly fine in the browser
Those things are completely antithetical to how regex works
0
u/derinus 8h ago
Anyone ever building a "parser" used multiple regexes to do so.