js design a long time ago, replace (reg, text), The first of these parameters, we generally used only when the partition at the actual, it is to support the regexp, and use of the overall regexp can easily attribute replaceAll, as long as some regexp basis, they will understand:
example: "2009-05-25" -> "2009_05_25"
var reg = / - / g;
var param = "2009-05-25";
var result = param.replace (reg, "_");
--------
result: 2009_05_25







