Help with coldfusion regex to remove mce_href from within a link tag

Hi,

I am using the TinyMce editor and I would like to remove some of the mce_href and mce_img tags from within the html.

I have found a link to a regex which should work but need it translated into coldfusion code:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_22565810.html

Thanks

Chris
marketboyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

James LooneySr. Programmer/AnalystCommented:
you may want to move this to the coldfusion section.
0
SidFishesCommented:
this should work

<cfsavecontent variable="test">
<html>
<head>
</head>
<body>
<a href="foo">blah</a>
<mce_href="foo">blah</a>
</body>
</html>

</cfsavecontent>
<cfset output = REReplaceNoCase(test, "/mce_(src|href)=""[^""]*?""/", "", "all")>
<cfoutput>#output#</cfoutput>
0
marketboyAuthor Commented:
SidFishes, the code would work when the mce_href is a tag in itself, the problem is that it is contained within the <a> tag like so:

<cfsavecontent variable="test">
<html>
<head>
</head>
<body>
<a href="foo" mce_href="foo">blah</a>
</body>
</html>

</cfsavecontent>

And as such the code doesn't work
0
SidFishesCommented:
wasn't sure exactly what we were replacing


try this
<cfset output = REReplaceNoCase(test, "mce_(src|href)=""[^""]*[a-z]""", "", "all")>


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.