Subsribe to our RSS

latest reactions

christian louboutin shoes
With that kind of traffic you want to ad …
Rahul Anand
Thanks for the nice post. It works for m …
Serkan
thx a lot! …
msb
Thanks for above solution.There is ano …
Lori S.
FYI, I was using this successfully in CF …

Use OpenDNS

mxna feeds

cfmailparam behaviour change in CF9.01ColdFusion Job Opportunity in Houston, TXFacial Recognition in 14 Lines Of ColdFusionColdFusion UPS PackageColdFusion Job Opportunity in Arlington, VAColdFusion Job Opportunity in San Diego, CASome ColdFusionBloggers.org GuidelinesColdFusion Positions In CaliforniaListChangeDelimsunix epoch with coldfusionQuery scripting bug in Coldfusion 9Scoth On The Rock 2011 Tickets on salefoursquareCFC updated to version 1.0, now includes ColdFusion return typeFramework One Birds of a Feather session at CFUnitedWhat makes you a good ColdFusion programmer?

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2010 mximize.com.
All right reserved.

MXNA webfeed

Visit Carlos Gallupa

How to strip HTML tags from a string?

You can get this result with the following regular expression

<cfsavecontent variable="str">
  <html>
    <body>
    This is the text you want
    </body>
  </html>
</cfsavecontent>

<cfset textstr = REReplace(str,'<[^>]*>','','all')>

<cfoutput>
  #textstr#
</cfoutput>

9125 viewed | 5 opinion(s)  | del.icio.us | Digg it | Tjarko @ 02/11/02 18:23 cet


Reactions:

JVirus wrote....

This is nice to know, too bad it isnt as easy to just have truncating text overlook HTML.

23 July 2007 22:42 cet  

Joshua Giese wrote.... (site)

wow, very simple. I was going to use a UDF i found here... http://www.opensourcecf.com/1/2006/11/Using-coldfusion-to-strip-some-or-all-HTML-tags-from-a-string.cfm

Your method is way more direct. thanks!

28 June 2008 1:15 cet  

Nick wrote....

This is awesome! Saved me a lot of time.

Cheers,
-Nick

31 July 2009 20:50 cet  

Michael wrote.... (site)

The site: http://www.feed-squirrel.com/index.cfm?evt=viewItem&ID=31247 seems to show a good function.

28 August 2009 16:39 cet  

james wrote.... (mail)

This works neat as you please.Very eligant solution.

18 May 2010 22:53 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!