标签:wan 数字 undefined fas exe ups fine test .exe
test 判断字符串是否符合规定的正则
exec 获取匹配的数据
例子:
test例子
rep = /\d+/; //只要有数字就返回true
rep.test("asdkfasdkf9999")
true
rep.test("asdkfasdkf")
false
rep = /^\d+$/; //全部是数字返回真
exec例子
rep = /\d+/;
rep.exec(str);
["88", index: 6, input: "wangn_88_skjffaf_33", groups: undefined]
标签:wan 数字 undefined fas exe ups fine test .exe
原文地址:https://www.cnblogs.com/brownyangyang/p/9291007.html