I'm trying to read in an HTML page and wipe out any javascript that might be living on it... but I'm having trouble with the following call:
$nojava = eregi_replace("<SCRIPT.*?</SCRIPT>", " ", $htmlwithjava);
since there could be 1..n script blocks, I obviously want to use the non-greedy (otherwise it would wipe out everything between* two blocks as well). Near as I can tell, PHP does not seem to appreciate the ?.
The above code produces a REG_BADRPT error. Not including the ? allows the code to work with no error, but in "greedy" mode.
Anyone know why the ? throws an error?
Thanks!
-Carl