正则判断字符串是否为数字

var re =/^(-?\d+)(\.\d+)?$/;   //判断字符串是否为数字

var re=/^[A-Za-z0-9]+$/;  //字母和数字组合

原文地址:https://www.cnblogs.com/peterdys/p/2731502.html