js 正则exec()函数在循环中使用

在每次循环中,需要把正则表达式的lastIndex重置为0。如
reg.lastIndex=0

posted @ 2020-10-30 10:16  糖糖部落  阅读(444)  评论(0编辑  收藏  举报