new RegExp(/^[-]?((([1-9]+[0-9]*|0)[.][0-9]*[1-9]+[0]*)|([1-9]+[0-9]*|0))$/, 'g').test("0.1"); 转载于:https://www.cnblogs.com/linxianfeng/p/8074737.html