See
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0a38f-7ffb.html
for
the flag to trigger multi-line capabilities in regex.

(?m)<script\b[^>]*>.*?</script>

should do it.

<cfset newString = rereplaceNoCase( string ,
'(?m)<script\b[^>]*>.*?</script>' , '' , 'all' )>

On Tue, Apr 6, 2010 at 9:29 PM, UXB Internet <[email protected]>wrote:

>
> I am at a loss as to how to structure a regex to remove a JavaScript block
> from a file using CF5.  What I am trying to do is remove the "<script" and
> everything including and between /script>". something like this:
>
> <script language="JavaScript">
>        <!--
>
>           JavaScript code here
>
>        // -->
> </script>
>
> I have tried this but it give me and error: Bad regular expression
>
> <cfset Newstring = ReReplaceNoCase(string,"<script.*?>.*?</script>","",
> "all")>
>
> Assistance would be appreciated.
>
>
> Dennis Powers
> UXB Internet - A Website Design & Hosting Company
> P.O. Box 6028
> Wolcott, CT 06716
> 203-879-2844
> http://www.uxbinternet.com
>
>
>
>
>
>
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332688
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to