var str= '00asfasdfasdf3435asdas874747474asdf'; console.log(str.replace(/[^0-9]+/g, '')); 转载于:https://www.cnblogs.com/gaocong/p/5801910.html