[plug] Perl regex question

William Kenworthy billk at iinet.net.au
Sun Oct 26 09:57:10 WST 2008


For one off's, this sort of thing is easier done in awk.

BillK

On Sun, 2008-10-26 at 01:43 +0800, Arie Hol 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 read the Perl documentation which tells me to use the /s and /m 
> switches - but I can't get the desired results.
> 
> The above example does not seem to do anything at all - it doesn't throw 
> an error or give me any feed back.
> 
> What am I doing wrong ????
> 
> Any help appreciated.
> 
> Regards Arie
> ------------------------------------------------------------------
>  For the concert of life, nobody has a program.
> ------------------------------------------------------------------
> _______________________________________________ PLUG discussion list: plug at plug.org.au http://www.plug.org.au/mailman/listinfo/plug Committee e-mail: committee at plug.linux.org.au
-- 
William Kenworthy <billk at iinet.net.au>
Home in Perth!




More information about the plug mailing list