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: 432
JavaScript
|regex
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