ColdFusion: rereplace xml formatted html-tags regex

Hellswinter

New Member
I've found a working solution to remove all html-tags as follow:\[code\]<cfset test = rereplace(blah, "<h2[^>]*>", "", "ALL") />\[/code\]I need to generate a xml file and rename some tags after they were formatted with XMLFormat().Thus I tried the following:\[code\]<!--- example string ---><cfset blah = '<h1>title 1</h1> <h2 style="color: black;">title 2</h2> <h3>test</h3>' /><cfset test = rereplace(blah, "<h2[^>]*>", "<title_2>", "ALL") />\[/code\]This changes my tag as I want, but it doesn't stop at the > part?...I also tried to escape the ampersand like this \[code\]\<h2[^>]*\>\[/code\], but that doesn't seem to help.
 
Back
Top