JavaScript language: regex escaped highlighting does not terminate correctly
To reproduce:
// The regex matches the token, the token property contains the type
{regex: /"(?:[^\\]|\\.)*?(?:"|$)/, token: "string"},
// You can match multiple tokens at once. Note that the captured
// groups must span the whole string in this case
{regex: /(function)(\s+)([a-z$][\w$]*)/,
token: ["keyword", null, "variable-2"]},
The brown highlighting starting in the regex spills over and does not terminate when the regex ends.