Aha, the problem is that the regex highlighter doesn't realize that / inside  doesn't need to be escaped.
These regexes are equivalent:
- Code: Select all
But Sublime only correctly highlights the second one.
This is a language file problem, and also one of those situations I consider "just because you can, doesn't mean you should". I am always explicitly escaping things like that for consistency in my code (I think it makes it very clear that way). I realize though that it is valid if the slash is not escaped in the  block, but escaping it will always mean that less intelligent parsers and less experienced coders don't get confused. It doesn't mean I won't come across someone else's code were they don't escape stuff like I do, and it would be nice if the highlighter was able to catch this stuff, but In order to do this proper, it takes quite a bit more complexity in the language file to recognize valid un-escaped slashes. And I am sure this issue exists in multiple languages all implementing stuff like this slightly different.
I realize opinion may differ on this...