It'll probably be worthwhile to carefully look at the pages it fails on (and where in the page it fails.)
I'm just guessing, but it might be that you've found some endtags with space in them... if so, just be a little more liberal in how you match the endtag.
This might do it:
$foo =~ s|<\s*script[^>]*>.*?</\s*script\s*>||gis;-sauoq "My two cents aren't worth a dime.";
In reply to Re: Stripping the contents of Javascript tags
by sauoq
in thread Stripping the contents of Javascript tags
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |