<?php
eregi("[phpcode](.*)[/phpcode]",$php_code);
highlight_string($php_code);
echo $php_code;
?>
i'm not sure if that is how you escape [] is regular expressions, but that should work.
highlight_string will not highlight anything that isn't between the php start and stop tags (like <?php ?>), so you might have problems there too.
basically what you are looking for is the function highlight_string()
RTFM.