正则表达式 金额验证

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('验证失败');
 }
原文地址:https://www.cnblogs.com/shaozhu520/p/12123129.html