Why is it that JSLint returns a 'Bad escapement' on the following JavaScript line ?
param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
From JSLint documentation I thought that this would be ok since the regex literal is preceeded by a parenthesis:
Regular expressions are written in a terse and cryptic notation. JSLint looks for problems that may cause portability problems. It also attempts to resolve visual ambiguities by recommending explicit escapement.
JavaScript's syntax for regular expression literals overloads the / character. To avoid ambiguity, JSLint expects that the character preceding a regular expression literal is a ( or = or : or , character.