let reg = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^[1-9]$)|(^\d\.[1-9]{1,2}$)|(^\d\.[0]{1}[1-9]{1}$|(^\d\.[1-9]{1}[0]{1}$)$)/;
 let num = 0.01;
 if (reg.exec(num)) {
     console.log('验证通过');
 } else {
     console.log('验证失败');
 }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2022-01-09
  • 2021-09-05
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案