A better function to use would be preg_replace_callback()
for this as you can then pass the matched text to a callback function for reformatting.
Here's an example implementation: (this may need some tweaking but you should get the idea)
function code_tag_replace( $matches ) {
$ret = '<TABLE WIDTH="100%" CELLSPACING="0" CELLPADDING="10" CLASS="code" BORDER="0"><TR><TD><SPAN CLASS="xcode">';
$ret .= SyntaxHighlight::process( $matches[1] );
$ret .= '</SPAN></TD></TR></TABLE>';
return $ret;
}
$body = preg_replace_callback(
'#\[code\](.*)\[/code\]#isU',
'code_tag_replace',
$body
);