javascript正则表达式验证邮箱数字等
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
/**
*@author Gongziqian
*QQ:812599742
*/
/**
* 目前所支持的校验类型有:
+-----------------------+---------------------------------------+-------------------------------------------------------+
| 类型| 校验函数| 描述|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|number |f_check_number(obj) |数字
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|naturalnumber |f_check_naturalnumber(obj) |自然数
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|integer |f_check_integer(obj) |整数
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|float |f_check_float(obj) |实数
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|zh |f_check_zh(obj) |汉字
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|lowercase |f_check_lowercase(obj) |小写英文字母
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|uppercase |f_check_uppercase(obj) |大写英文字母
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|letter |f_check_letter(obj) |英文字母
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|ZhOrNumOrLett |f_check_ZhOrNumOrLett(obj) |汉字、字母、数字组成的字符串|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|IP |f_check_IP(obj) |计算机的IP地址
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|port |f_check_port(obj) |计算机的IP地址的端口号
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|URL |f_check_URL(obj) |网页地址
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|email |f_check_email(obj) |电子邮件地址
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|mobile |f_check_mobile(obj) |移动电话号码
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|phone |f_check_phone(obj) |电话号码
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|zipcode |f_check_zipcode(obj) |邮政编码
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|userID |f_check_userID(obj) |用户ID,可以为数字、字母、下划线的组合,第一个字符不能为数字, |
| | |且总长度不能超过20。|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|IDno |f_check_IDno(obj) |身份证
|
+-----------------------+---------------------------------------+-------------------------------------------------------+
|formatStr(reg) |f_check_formatStr(obj) |符合某正则表达式的字符串。指定的字符串中不要包含"//",也不需要引号. |