This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The following javascript code is highlighted wrong (red underline): var a = function(theFunction){ return /function (.*)\(/.exec("" + theFunction)[1]; } although internally the syntax tree seems to be ok. The problem seems to be at lexer level. More precisely, the divIsRegexp flag from org.mozilla.nb.javascript.TokenStream is wrong so the regexp isn't detected properly. Thus, SyntaxHighlighting gets a Token.ERROR in the TokenSequence and ends up highlighting those ranges. I wanted to fix this bug myself but then I found these lines in TokenStream: // THIS IS NOT COMPLETE; there are other possible constructions with operators but covers 90+% of cases divIsRegexp = (token == Token.LP || token == Token.COMMA || token == Token.NOT || token == Token.ASSIGN || token == Token.SEMI || token == Token.COLON); which made me believe the whole regexp support at lexer level is more or less volatile. I'm posting this bug as a testcase for you and as a reminder for myself. Given the heuristics used to detect regular expressions, I don't see a clear solution to fix this.
Created attachment 107182 [details] Screenshot of the bad highlighting
Fixed for 7.3.