在每次循环中,需要把正则表达式的lastIndex重置为0。如
reg.lastIndex=0
js 正则exec()函数在循环中使用
最新推荐文章于 2024-05-18 15:33:22 发布
在每次循环中,需要把正则表达式的lastIndex重置为0。如
reg.lastIndex=0