会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
代码练习册
勤练带来力量
博客园
首页
新随笔
联系
订阅
管理
2022年8月31日
正则表达式第一次为true第二次为false的原因
摘要: test() exec() 会从 lastIndex 位置开始检索 两种方案: 不使用 g 重置 lastIndex const pattern = /^\d+$/ function validateNumber(value) { const result = pattern.test(value)
阅读全文
posted @ 2022-08-31 15:47 月半流云
阅读(31)
评论(0)
推荐(0)
编辑
公告