Doug,

Do you want to strip out all HTML, or just "a" tags? What about words that 
appear otside of the link?

For example:

another <a href=this,that and the other>word</a> problem

Should that become:
another word problem

or:
word

If you want to strip out all html, and leave words outside the tag, use 
stripHTML():
http://www.cflib.org/udf.cfm?ID=12

If you want to strip just "a" tags and leave words outside the tag, use this:
REReplaceNoCase(str,"</?a[^>]*>","","ALL")

If you want to get only the text between the "a" tags, use this:
<cfscript>
function anchorText(string) {
        var result = "";
        var AnchorTag = ReFindNoCase("<a[^>]*>[^(</a>)]*</a>",string,1,true);
        var tag = "";
        if ( AnchorTag.pos[1] AND AnchorTag.len[1] ) {
                tag = Mid(string,AnchorTag.pos[1],AnchorTag.len[1]);
                result = ReReplaceNoCase(tag, "</?a[^>]*>", "", "ALL");
        }
        return result;
}
</cfscript>

If your need is otherwise, let me know.

Steve Bryant
918-449-9440
Bryant Web Consulting LLC
http://www.BryantWebConsulting.com/
http://steve.coldfusionjournal.com/ 

>Was wondering how I would strip out everything between
>
><a href=this,that and the other>word</a> and just leave the word?
>
>
>Any ideas

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251225
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