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.
Code:
"(?=((?!<\/?em).)*<\/em>)
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.
Comment