You can't parse [X]HTML with regex

Henry Catalini Smith

html - RegEx match open tags except XHTML self-contained tags - Stack Overflow

I need to match all of these opening tags: <p> <a href="foo"> But not self-closing tags: <br /> <hr class="foo" /> I came up with this and wanted to make

Bookmark

The infamous Zalgo answer about parsing HTML with regex on Stack Overflow. I’m decently sure this answer was how I first discovered Zalgo.