var str = "2.65KM之内";
var strstr = "字符串zifuchuan36.254KM之内";
var num = str.replace(/[^0-9\\.\\^0-9]/ig,""); //结果: 2.65
var numPre = strstr.replace(/[^0-9\\.\\^0-9]/ig,""); //结果 36.254