There are a couple of problems like that, URLs inside strings (causes highlight as comments), and few other things.
Ultimately this should probably be rewritten to have an actual parser instead of global regular expressions.