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 <a>">
I have tried:
Replace(string , "<[^>]*>", "", "ALL")
Replace(string , "<br &##x2f;>>", "", "ALL")
Neither remove the html, can anyone help?
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>
Copy link to clipboard
Copied
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>