In answering this PHP question: regex - preg_replace string, I came across something in Javascript I didn't understand. Given the following:
var s = "abc1!?d$";
alert(s.replace(/\W+/, " "));
I am alerted:
abc d$
Why is it not stripping out the last dollar?