The hypertext (HTML), xml, and cpp lexers recognize regular expression literals in JavaScript. These start and end with '/' so may appear like this
'/' is also used for division so there is some code to choose between the '/' being an operator or the start of a regular expression literal. The implementation is not always accurate. It examines previous text for various characters that imply the likelihood of one choice. The regular expression literal terminates after another '/' but it also terminates at the end of the line.
This implies that a regular expression literal can not continue onto subsequent lines. I have not found a definitive statement that this is the case but searching for related terms on the web did not produce contradicting evidence.
Therefore, it may improve the lexers to only transition to regex literal style when the initiating '/' is followed by at least one more '/' on the same line.
Neil