摘要: 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) 编辑