ColdFusion Strip HTML tags from text

This RegEx is very basic, it will only work on valid HTML attributes. That is, if an element attribute contains the > character, it will fail. It will also fail if any of the HTML contains < or > symbols that are unencoded as < or > respectively. The check for the forward slash isn't necessary but it does help to identify what the RegEx is doing.
<cfset noHTMLTags = REReplaceNoCase(text, "<[\/]?[^>]*>", "", "ALL")>
Posted by
Snippet Viewed 12184 times.

Share your ColdFusion code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.


Submit | Browse

Most Recent coldfusion snippets

Most Viewed