/^\d+(?=\.{0,1}\d+$|$)/.test(0) // true 转:https://www.jianshu.com/p/feef5e62dd67 转载于:https://www.cnblogs.com/xiangsj/p/11422559.html