大于0.01小于100000的正则能写出来吗?
首先。。为什么要用正则。。
以及,正则的实现方式:
(() => {
let reg = /^(0(\.(0[^\D0])|([^\D0]\d)))|(((\d)|(0\d{0, 4}[^\D0])|([^\D0]\d{0, 5}))(\.((\d)|(0\d{0, }[^\D0])|([^\D0]\d{0, })))?)$/
let count = 0.01
while (count <= 100000) {
if (!reg.test(String(count))) {
console.log('Error: ', String(count))
}
count += 0.01
}
console.log('done')
})()
正则?
num>0.01&&num<100000
?