I'm trying to strip extra characters out of some static HTML pages that we have; characters like line breaks, and extra formating tabs.
The problem is: if i have a javascript on the page that has a one line comment, and i remove the line break, then all the code is considered to be on the same line... example:
<script>
// this does stuff
doStuff();
</script>
This winds up as:
<script>// this does stuff doStuff();</script>
I need a regular expression that will either:
1) remove \n, \t, and \r from anywhere outside <script> </script> tags, or
2) remove any one line comments like "// foo"
I've tried a few things with no luck...
-andy