At 7:07 PM -0400 6/2/01, Jon Hall wrote:
>For anyone else that is interested here is the final code.
>This program will parse out url's out of any file.
>
>Still think there is a better way to do this though...

Yeah, there is... you can do it with 2 ReReplaceNoCase commands:


<cfset x =
"
this is some stuff<Head>some other stuff</head><body>yet some more stuff
la la la<a href=www.abc.com>abc</a> do do do do <a href=www.cbs.com>
cbs</a>fa fa fa fa fa <a href=www.fox.com>fox</a>re re re re
<a href=www.nbc.com>nbc</a>
">


<cfset s = chr(01)> 
<cfset e = chr(02)>

<cfset y = ReReplaceNoCase(x, "([\<]a[^\>]+>[^\<]+\<\/a\>)", 
"#s#\1#e#", "All")>
<cfset y = ReReplaceNoCase(y, "[^#s#]*#s#([^#e#]+)#e#", "\1", "All")>

<cfoutput>
<code>
<br>Before....|#Replace(x, "<", "&lt;", "All")#|
<br>
<br>After.....|#Replace(y, "<", "&lt;", "All")#|
</code>
</cfoutput>


HTH

Dick

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to