如何用正则表达式去除一个字符串里面的数字和小数点以外的字符

如题所述

var reg = /[^\d\.]/g;
var html = "sdf12.323.sdf3sd.32";
html.replace(reg,"");
温馨提示:答案为网友推荐,仅供参考
相似回答