验证IP地址、登录帐号、密码、EMAIL、电话号码[包括手机和固定电话
var patterns = new Object();
var thePat;
var r, re;
patterns.ip = /^(d{1,2}|1dd|2[0-4]d|25[0-5])(.(d{1,2}|1dd|2[0-4]d|25[0-5])){3}$/g;
patterns.id = /^[A-Za-z0-9_]{1,20}$/g;
patterns.ps教程w = /^[a-zA-Z0-9]{6,20}/g;
patterns.email = /w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/g;
patterns.num = /^d{1,10}$/g;
patterns.post = /^[1-9]d{5}$/g;
patterns.tel = /^(1(3|5)[0-9]d{8})|(0[1-9]{3}[-][1-9]d{6,7}[-]d{1,5})|(0[1-9]{2}[-][1-9]d{7}[-]d{1,5}|([1-9]{1}d{6,7})|(0[1-9]{3}[-][1-9]d{6,7})|(0[1-9]{2}[-][1-9]d{7}))$/g;
patterns.net = /^http://([w-]+.)+[w-]+(/[w- ./?%&=]*)?/g;
patterns.date = /^[1-9]d{3}[-]((0[1-9])|(1[0-2]))[-]((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))$/g;//yyyy-MM-dd
patterns.variable = /^[A-Za-z_][A-Za-z0-9_]{0,120}$/g;//变量名,以下划线或者字母开头,的由字母、数字和下划线组成的字符串