I Have string var:
Some text...<div class=example><pre><ul><li>Item</li></ul></pre><div class=showExample></div></div>Some text...
I want replace all < and > chars in pre tag to html entity = <
and >
So i wrote this Script:
text = text.replace(new RegExp("(?=(<pre>.*))<(?=(.*</pre>))","ig"),"<");
text = text.replace(new RegExp("(?=(<pre>.*))>(?=(.*</pre>))","ig"),">");
I always get this result:
<p>Some text...<div class=example><pre><ul><li>Item</li></ul></pre><div class=showExample></div></div>Some text...</p>
Why???