Subsribe to our RSS

latest reactions

j
We are in the same situation …
jax
Allthough this doesn't look as if it is…
joe coder
I came across your post from a Google se …
jax
use a public proxy... connect through th …
Tjarko
I use the webservice from maxmind http:/ …

mxna feeds

Transfer's getMemento() has ChangedActive Directory LDAP AuthenticationWho's on the CFMeetup this week,Thurs Aug 21Subversion Makes a Fool out of MeCFMeetup Presentation August 21 @ High NoonColdFusion Academic Version: Curriculum NeededClustering ColdFusionColdFusion Variety Show on August 26 at 6:00ColdFusion Team is looking for feedback from Flex/AIR - CF ShopsHigh Availability Clustering with ColdFusion Article PostedcfExcelProxy - Returning Available StylesBFlex - AIR Messaging: Integrating AIR, BlazeDS, and ColdFusionBFlex - AIR Messaging: Integrating AIR, BlazeDS, and ColdFusionColdFusion Ajax Bindings - Form Fields only?ColdFusion 9 Static Classes

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

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