Easy Javascript Regex Question

Posted by Matrym on Stack Overflow See other posts from Stack Overflow or by Matrym
Published on 2010-06-09T07:15:24Z Indexed on 2010/06/09 7:22 UTC
Read the original article Hit count: 408

Filed under:
|

Why doesn't this assign prepClass to the string selectorClass with underscores instead of non alpha chars? What do I need to change it to?

var regex = new RegExp("/W/", "g");
var prepClass = selectorClass.replace(regex, "_");

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex