let result = /(?<=(\d+)(\d+))$/.exec('1053');
结果:
result = ["","1","053"];
问题:
为什么 result[0]=""
let result = /(?<=(\d+)(\d+))$/.exec('1053');
结果:
result = ["","1","053"];
问题:
为什么 result[0]=""
贪婪匹配,零宽度断言吃掉了全部的数字,所以匹配出来就没了
这种写法取决于正则表达式解析器的实现,不同的库输出不同,没啥可以讨论的