preg_replace is probably the most direct route to go with this. Here's a quick example that works on comments and (0:7) lines:
PHP Code:
$srch = Array(
'/^(\*.*)/',
'/\((\d*\:\d*)\)/',
);
$replace = Array(
"<font color=aqua>\${1}</font>",
"(<font color=green>\${1}</font>)",
);
$str = preg_replace($srch, $replace, $foo);
Instead of trying to create one regex for all replacements you can just keep adding search/replace items to the arrays and it'll be easier to maintain.
-r