[plug] Perl regex question

Carl Gherardi carl.gherardi at gmail.com
Sun Oct 26 03:04:59 WST 2008


On Sun, Oct 26, 2008 at 1:43 AM, Arie Hol <arie99 at ozemail.com.au> wrote:
>
> Greetings to all,
>
> I am trying to run a perl script which needs to apply a regex which will
> be effective over multiple lines.....
>
> I would like to remove multiline javascript statements from within a web
> page which I want to archive.
>
> Example :
>
> <script language="javascript">
>        I want to remove
>        the javascript lines as well as
>        the "script" tags which run over several lines
> </script>
>
> I have tried many different permutations, including the following :
>
> $line =~ s/<script.*script>//smi ;

I assume the whole file is in that line yes? if so that should work.

>From shell:
# perl -e 'print "found\n" if "<line\
<line\
line\
end>" =~ /<line.*end>/ms'
found
#



More information about the plug mailing list