Subsribe to our RSS

latest reactions

jax
store the script path to the settings.cf …
Tjarko
hmmm not sure, it was a component that a …
Michael van Leest
Access="private" functions?? …
wese
It does work, as long as you know what y …
Allen
cfquery is not a scope …

Use OpenDNS

mxna feeds

First Bangalore ColdFusion UsergroupOCDev July Meeting: Geolocation with ColdFusion by Oğuz DemirkapıCF8 and FCKEditor Security threatColdFusion: Experiment Converting MS Word to HTML/PDF - Part 2 ExampleAnt Presentation FilesQuick example of Java via ColdFusion - Reading FLV MetadataCFUG NL sign up now!ColdFusion 8's OnMissingTemplate() - So Close To Being GoodWhy setting the right concurrent thread count is importantMy Encounter With a ColdFusion Detractor (Part 2)Why setting the right concurrent thread count is importantWhy setting the right concurrent thread count is importantColdFusion: Experiment Converting MS Word to HTML/PDF (At Last) - Part 2Examining my ColdFusion job searchAre there really ColdFusion jobs?

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2009 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>

4617 viewed | 2 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  

Leave your comment

Your name


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


Some room for your reaction is placed here..



A dozen apples are how many?? (12 would be a good answer for this)




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