Page 1 of 1

Strip tags with regular expression

Posted: Sat Oct 11, 2003 7:25 pm
by kongharald
I want to remove all <script>-tags and their content from a buch of HTML-files.

However, RegExps like
<script[^>]*>.*</script>
doesn't seem to work, since the "." operator excludes newline characters (\n)

How do I write a RegExp replace statement in TextPad that works with multi line strings?

Posted: Sat Oct 11, 2003 8:57 pm
by MudGuard
First,
replace all \n by a character or character sequence that does NOT appear in your file(s) - e.g. @@@

Then do the replace that you have in mind.

Then replace the character sequence from step one by \n again.