Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

help removing encoded html from string

Explorer ,
Mar 26, 2015 Mar 26, 2015

Hello,

I am trying to remove all html from a user input string.

something like this:

<cfset string ="sample text &lt;a&gt;">

I have tried:

Replace(string , "<[^>]*>", "", "ALL")

Replace(string , "&lt;br &##x2f;&gt;>", "", "ALL")

Neither remove the html, can anyone help?

TOPICS
Getting started
470
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 04, 2015 Apr 04, 2015

The related functions for replacing strings using regular expressions are REReplace and REReplaceNoCase. For example,

<cfset string ="sample text <a>">

<cfoutput>#REReplace(string , "<[^>]*>", "", "ALL")#</cfoutput>

Translate
Community Expert ,
Apr 04, 2015 Apr 04, 2015
LATEST

The related functions for replacing strings using regular expressions are REReplace and REReplaceNoCase. For example,

<cfset string ="sample text <a>">

<cfoutput>#REReplace(string , "<[^>]*>", "", "ALL")#</cfoutput>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources