Does the proposed regular expression really handle embedded script content correctly? From my limited understanding of HTML, pretty much only </script> counts as closing the script contents and everything else is treated as part of the script.
I've seen plenty of plain HTML files that aren't well-formed XML yet contain <br/> tags.