Try:

preg_replace( "/<script.*>((.|[[:space:]])*)<\/script>/", "\\1",
$myHTMLstring )

seems to work here - applies to both cases

HTH
Ignatius
____________________________________________
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 16, 2002 11:44 AM
Subject: [PHP-WIN] reg expression for stripping Java scrips off HTML?


> Can anyone please provide me with the regular expression (Perl compatible
> or posix extended, whatever), that i can use to strip off the Java script
> tags and code of the HTML page. i have it 2 types:
>
> 1) <script language="javascript" src="***.js"> </script>
> and
> 2) <script>
> ----------code-------- \r\n
> ----------code-------- \r\n
> </script>
>
> i am using preg_replace("/(?s)<script[^>]{0,}script[*\s]{0,}>/iU",
> "--stripped--", $myHTMLstring) but this doesnt work properly.
>
> respects,
> YY.
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to