I am looking for some help with a regular expression. I have a scenarios, where I have strings, with <table> within <table> tags within them. I need to replace the outermost table tags with <pre><table>. How do I write this reg ex. What I am thinking of doing is this.
Take a string. Replace the inner tables with a @@@TABLEOPEN@@@ and @@@TABLECLOSE@@@ then replace all the table tags with <pre><table> and then replace the placeholder with <table>
ie. I would want
EGYEYUGEYUEUYEY<table cellpadding="23"><tr><td><table cellspacing="23"><tr><td>HGDHDHDJK</td></tr></table></td></tr></table>EGYEYUGEYUEUYEYEGYEYUGEYUEUYEY
with
EGYEYUGEYUEUYEY<pre><table cellpadding="23"><tr><td><table cellspacing="23"><tr><td>HGDHDHDJK</td></tr></table></td></tr></table></pre>EGYEYUGEYUEUYEYEGYEYUGEYUEUYEY
Any help would be appreciated
Take a string. Replace the inner tables with a @@@TABLEOPEN@@@ and @@@TABLECLOSE@@@ then replace all the table tags with <pre><table> and then replace the placeholder with <table>
ie. I would want
EGYEYUGEYUEUYEY<table cellpadding="23"><tr><td><table cellspacing="23"><tr><td>HGDHDHDJK</td></tr></table></td></tr></table>EGYEYUGEYUEUYEYEGYEYUGEYUEUYEY
with
EGYEYUGEYUEUYEY<pre><table cellpadding="23"><tr><td><table cellspacing="23"><tr><td>HGDHDHDJK</td></tr></table></td></tr></table></pre>EGYEYUGEYUEUYEYEGYEYUGEYUEUYEY
Any help would be appreciated