作者:璋-华_135 | 来源:互联网 | 2024-11-17 13:29
12345678910111213141516171819202122232425262728293031323334var re = /^\d{6,}$/g;var num1 = 622821066
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| 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 |
上面是谷歌控制台真实显示的内容
不知道是不是我正则写法问题
一会可以匹配 一会不能匹配 很奇怪