Reputation: 803
Just trying to have Sublime Text resume its color state.
Upvotes: 1
Views: 45
Reputation: 2623
There is nothing wrong with Sublime Text : You have an unescaped /
in your regex, which closes it prematurely. It should be \/
.
Upvotes: 2
Reputation: 71950
You could try using a call to RegExp and add your regexp as a string, but it's kind of silly to change your JavaScript to fix how your editor highlights.
i.e.
return new RegExp('[~`....?', 'g').exec(str);
Having said that, if you do it this way you shouldn't probably recreate that regexp with each function call, but outside of the function, there's no need to recompile that regular expression each time.
Upvotes: 1