var str = "123456abc1abc";
var re = /(\d+)(\D\D)/g; //结果是["123456ab", "1ab"]
// var re = /(\d+?)(\D\D)/g; //结果是["123456ab", "1ab"] 这里非贪婪不应该是6ab 和 1ab吗
console.log(str.match(re))
长风秋雁
相关分类