Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2008-11-10
5
Medium Priority
?
662 Views
Last Modified: 2012-05-05
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
0
Comment
Question by:marketboy
  • 2
4 Comments
 
LVL 6

Expert Comment

by:James Looney
ID: 22920948
you may want to move this to the coldfusion section.
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 22922948
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
 

Author Comment

by:marketboy
ID: 22937883
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
 
LVL 36

Accepted Solution

by:
SidFishes earned 500 total points
ID: 22939958
wasn't sure exactly what we were replacing


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


0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question