Automatic condensing of whitespace in HTML
I don't see much reason to use (*F) instead of the somewhat more understandable (*FAIL).
Consider using single-quoted (') strings for regular expressions to avoid \\1.
There's a big assumption here that the HTML will be well-formed. I assume (ha!) that this is okay.
Whitespace is significant in &lt;input&gt; tags.