正则匹配 数字和英文状态下的逗号 var regexp = /[^d,]*/g; newstr=str.replace(regexp,""); 只匹配数字(d)和英文状态下的逗号(,) 注:^在方括号表达式中使用,此时它表示不接受该字符集合。