您的位置: 首页 > IT文章 > js 正则exec()函数在循环中使用 js 正则exec()函数在循环中使用 分类: IT文章 • 2025-01-14 16:59:19 在每次循环中,需要把正则表达式的lastIndex重置为0。如reg.lastIndex=0