//正则表达式校验new RegExp(/^[1-9]\d{4,8}$/,"g").test(1234);//执行一个字符串所表达的方法 eval(this['字符串']) 正则表达式对象 本对象包含正则表达式模式以及表明如何应用模式的标志. 语法 1 re = /pattern/[flags] 语法 2 re = new RegExp("pattern",["flags"]) 参数 re 必选项.将要赋值为正则表达式模式的变量名. Patter…
function chk() { var patrn = /^\d+(\.\d+)?$/; var result = true; $("input[type=text]").each(function () { if (!patrn.exec(this.value)) { alert("请输入正确的数字!"); result = false; } }) return result; }…