Sublime Forum

Bug: SublimeText 3 has trouble highlighting JavaScript Regex

#1

When opening this file swagger.js in SublimeText 3
it takes the rest of the file as a comment/string

the trouble is that in javascript you use /regex/ to define regex strings

although it is a perfectly valid javascript string, sublime text has trouble highlighting it

if you take out the ' from the string op = nickname.replace(/\s!@#$%^&*()_+=\{\]};:<>|./?,\\'""-]/g, '_');

it highlights the rest of the file just fine

0 Likes