Well, no, I don't have an HTML regex engine, but I needed to do this:
Any programmer who's worked with HTML for more than about three seconds has quickly discovered that this is not a viable option. Is the HTML well-formed? Does it have extra whitespace? Did they quote their attributes properly? Is the attribute case consistent? It's a frustration.
Today, after a fair amount of searching and asking questions in the Perlmonks chatterbox, I discovered that I simply couldn't find an adequate tool to do this. Some of the treebuilder tools looked interesting, but the fine-grained control that I needed wasn't there, so I built such a tool. It's not done, but so far I can tell it to match a given document structure to another document structure and, if they match, replace the target HTML with the new HTML. I can ignore attributes, force them to be in the correct order or ignore their order, if I wish. I'm now going to start working on the text matching portion. It's been fun. Perhaps this is a CPAN module in the works?
Of course, if my past experiences with use.perl are any indication, someone's going to say "here's what you were looking for". I'd welcome that as I'm curious to see how my tool stacks up.