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

help removing encoded html from string

Explorer ,
Mar 26, 2015 Mar 26, 2015

Copy link to clipboard

Copied

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

Views

412

Translate

Translate

Report

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>

Votes

Translate

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

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

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
Documentation