摘要: 1. 参数复用 // 正常正则验证字符串 reg.test(txt) // 函数封装后 function check(reg, txt) { return reg.test(txt) } check(/\d+/g, 'test') //false check(/[a-z]+/g, 'test') / 阅读全文
posted @ 2019-04-15 16:22 _increase 阅读(442) 评论(0) 推荐(0) 编辑