摘要: 有哪些好处 1. 参数复用 // 正常正则验证字符串 reg.test(txt) // 函数封装后 function check(reg, txt) { return reg.test(txt) } check(/\d+/g, 'test') //false check(/[a-z]+/g, 'te 阅读全文
posted @ 2022-04-02 15:05 lzhflzjx 阅读(46) 评论(0) 推荐(1)