CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Regular Expressions:
Regex, HTML string modification



Dec 7, 2009, 8:39 PM

Post #1 of 1 (3046 views)
Regex, HTML string modification Can't Post

I have a regex that is designed to help improve readability for a html document.


The purpose of this regex is to escape " marks from within <EM> affected sentences. Example:

Before: <P>This "is" <EM>a <STRONG>"Test"</STRONG></EM></P>
After: <P>This "is" <EM>a <STRONG></EM>"<EM>Test</EM>"<EM></STRONG></EM></P>

Note the regex only affects " inside of <EM> elements. My problem is that i need to modify the regex to account for " inside of tags. <EM CLASS="a1"> or <STRONG CLASS="a1"> etc.

With the current regex those " marks will be modified. Any help in stopping that from happening would be appreciated.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives