Strip tags with regular expression

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
kongharald
Posts: 3
Joined: Sat Oct 11, 2003 7:17 pm
Contact:

Strip tags with regular expression

Post 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?
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post 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.
Post Reply