If I'm reading that correctly, LM, it's replacing the SCRIPT block with everything that's inside the SCRIPT block... in effect, stripping out the <SCRIPT> tags. Not quite what I was after. But
eregi_replace("(<SCRIPT>{1})(.*)(</SCRIPT>{1})"," ",$txt);
doesn't work either... because it operates in "greedy" mode (matches as much as it can get). Meaning, if there are, for example, two script blocks on the page with valuable HTML in between:
<HEAD>
<SCRIPT>
function blahblah...
</SCRIPT>
</HEADgt;
<BODY>
<P>Hello World. This is the content of my page.</P>
<SCRIPT>
document.write('Some inline JS stuff');
</SCRIPT>
</BODY>
eregi_replace would replace everything from the beginning tag of the first block to the ending tag of the second block... wiping out everything including the closing HEAD tag, the opening BODY tag and the content of the page.
I need to be able to throw the non-greedy switch (like '?' in PERL). And that's what seems to be causing the problem.
Thanks.
-Carl