Unescaped '^' with jslint

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-05-03T16:18:24Z Indexed on 2010/05/03 16:38 UTC
Read the original article Hit count: 424

Filed under:
|

This is my code:


/**********************************************************
 * remove non-standard characters to give a valid html id *
 **********************************************************/
function htmlid(s) {
 return s.gsub(/[^A-Z^a-z^0-9^\-^_^:^\.]/, ".");
}

Why does jslint throw this error?

Lint at line 5 character 25: Unescaped '^'.
return s.gsub(/[^A-Z^a-z^0-9^\-^_^:^\.]/, ".");

© Stack Overflow or respective owner

Related posts about jslint

Related posts about JavaScript