js 每隔四位加一个空格 var str = '2016060520103600466'; var str=str.replace(/s/g,'').replace(/(.{4})/g,"$1 "); alert(str);