+4

Buggy syntax highlighting for JS

Piotrek Koszuliński 7 years ago • updated 7 years ago 0
This regexp breaks syntax highlighting for JS:

/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i

(source: http://www.regular-expressions.info/email.html - characters inside [] don't have to be escaped).

What's more - after this regexp next lines are highlighted as string, even though in JS there are no multi-line strings.