Regex match comments and quotes
If it is PHP source code you want to highlight, why not use the tokenizer that's build into PHP itself? I use that and it seems to work fine:

$tokens = token_get_all($sourceCode);


Then all you have to do is walk through all the tokens and give them a color.

See: https://www.php.net/manual/en/function.token-get-all.php

No extra library, no faffing around with endless regular expressions.