var re = /^\d{6,}$/g;
var num1 = 6228210660042337762;
re.test(num1)
true
var num2 = 6228210660042337765;
re.test(num2)
false
var num2 = 6228210660042337765;
re.test(num2)
true
var num2 = 6228210660042337765;
re.test(num2)
false
var num2 = 6228210660042337765;
re.test(num2)
true
var num2 = 6228210660042337765;
re.test(num2)
false
var num2 = 6228210660042337765;
console.log(re.test(num2))
VM4611:2 true
undefined
var num2 = 6228210660042337765;
console.log(re.test(num2))
VM4612:2 false
undefined
var num2 = 6228210660042337765;
console.log(re.test(num2))
VM4613:2 true
undefined
var num2 = 6228210660042337765;
console.log(re.test(num2))
VM4614:2 false
上面是谷歌控制台真实显示的内容
不知道是不是我正则写法问题
一会可以匹配 一会不能匹配 很奇怪
浮云间
相关分类