That's what I thought. I would have to put all the tags in there I want to
remove like div, strong, font, etc...

Thanks.

-----Original Message-----
From: Paul Alkema [mailto:paulalkemadesi...@gmail.com] 
Sent: Tuesday, May 18, 2010 10:57 AM
To: cf-talk
Subject: RE: Remove html characters


Try this...

<cfset html = '<p><a href="">test with link</a> </p>' >
 
<cfset withoutHtml = REReplaceNoCase(html,"<a .*(href=['""]?)([^'"" ]+)['""
][^>]+>([^<]+)</a>","\3: \2","all") >
<cfset withoutHtml = REReplaceNoCase(withoutHtml,"<p[^>]*>",Chr(10),"all") >
<cfset withoutHtml = REReplaceNoCase(withoutHtml,"<[^>]+>","","all") >
<cfoutput>#withoutHtml#</cfoutput>

Paul Alkema
http://Paulalkema.com/



-----Original Message-----
From: Rick Sanders [mailto:c...@webenergy.ca] 
Sent: Tuesday, May 18, 2010 9:38 AM
To: cf-talk
Subject: Remove html characters


Hey all,

 

What's the best way to remove html characters and make something plain text?
reReplace?

 

Thanks,

 

Rick

Webenergy

 

 








~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333775
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to