Regex/Javascript syntax highlighting bug
I am using regex to validate an email input field as described here: http://www.regular-expressions.info/email.html
When I use that regex in my javascript, the syntax in rest of my document after the regex is incorrectly highlighted. Try copying and pasting the following code into a javascript file.
if($('form.contact input.email').val() == '' || !$('form.contact input.email').val().match(/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/)) {
hasError = true;
$('form.contact input.email').addClass("error");
console.log('Email is at fault');
}
Is anyone else having this issue? I am using ST3, pretty sure it does it in 2 as well.
Customer support service by UserEcho
http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8495
For Sublime Text 3 for OS X, you need to extract JavaScript.tmLanguage file first:
Then edit JavaScript.tmLanguage file as the post said (in line 650):
Save the file, there should be an immediate effect on the opened JavaScript files.