This will strip the link tags from around text contained in variable mytext:

<cfset newtext = rereplacenocase(mytext,"(<a
[^>]*>)([^<]*)(</a>)","\2","all") />
<cfoutput>#newtext#</cfoutput>

Using back-references, \2 refers to the text between the <a></a> tags.
I believe that \1 would refer to the <a> tag and associated attributes.
\3 would refer to the </a> tag.

Cheers,
Kris

> I have the following string...
>
> This is a <a href="http://www.foobar.com";>Link</a> to foobar.
>
> I would like to pull out the HTML from this statement so that I have
>
> This is a Link to foobar.
>
> This will also allow me to make a forum widget that allows
>
> [url]http://www.foobar.com[/url]
>
> to change into
>
> <a href="http://www.foobar.com";>Link</a>
>
> Any ideas how I can capture the text between the <>'s and/or the text
> between the tags?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306193
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to