$string = preg_replace(/\[code\].*\[\/code\]/i, "", $string);
I think that'll knock them out of $string. Are you good with plugins?
EDIT: Wait a minute, let me work on that some more.
EDIT2:
Here we go (I think)
$string = preg_replace(/\[code\][\s\S]*?\[\/code\]/i, "", $string);
--------------- Added [DATE]1321771433[/DATE] at [TIME]1321771433[/TIME] ---------------
All wrong about that. What I posted would match bb code. You will need to match
html for a code box
PHP Code:
$regexp = '/<div class="smallfont" style="margin-bottom:2px">Code:<\/div>[\s\S]*?<\/pre>/i';
$string = preg_replace($regexp, "", $string);