Subsribe to our RSS

latest reactions

Montana Flynn
haha …
some1
Hi, Thank you for help me testing my sit …
metin2 yang
it is very nice …
Tjarko
I would'nt use cfhtmlhead for anything ; …
Sebastiaan
Hi Tjarko,Would you suggest injecting…

Use OpenDNS

mxna feeds

A Special ColdFusion Builder Event in Tampa, FLColdFusion Contract Job in Marbella, SpainColdFusion Job Opportunity in West London, United KingdomColdFusion Job Opportunity in Bethesda, MDColdFusion Job Opportunity in Springfield, MOColdFusion Job Opportunity in Seattle, WAColdFusion Builder - RefactoringColdFusion Job Opportunity in Raleigh, NCColdFusion Job Opportunity in Quincy, MAColdFusion Job Opportunity in Memphis, TNColdFusion Job Opportunity in San Antonio, TXUsing Base64 Canvas Data In jQuery To Create ColdFusion ImagesMy move from using cfhttp and rssatom.cfc to cffeed.Infinite entities, cfgrid and one cfc to handle the dataJob: ColdFusion Developer - Marbella, Spain

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

MXNA webfeed

Visit Carlos GallupaPowered by ColdFusion MX

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>

7173 viewed | 4 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  

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!!