本文主要是介绍东京商城注册页面使用的正则表达式......,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
京东商城注册页面找到的一组,正则表达式,验证规则比较准确,包括几乎包括所有常用的规则。
decmal: "^([+-]?)\\d*\\.\\d+$", //浮点数decmal1: "^[1-9]\\d*.\\d*|0.\\d*[1-9]\\d*$", //正浮点数decmal2: "^-([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*)$", //负浮点数decmal3: "^-?([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*|0?.0+|0)$", //浮点数decmal4: "^[1-9]\\d*.\\d*|0.\\d*[1-9]\\d*|0?.0+|0$", //非负浮点数(正浮点数 + 0)decmal5: "^(-([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*))|0?.0+|0$", //非正浮点数(负浮点数 + 0)intege: "^-?[1-9]\\d*$", //整数intege1: "^[1-9]\\d*$", //正整数intege2: "^-[1-9]\\d*$", //负整数num: "^([+-]?)\\d*\\.?\\d+$", //数字num1: "^[1-9]\\d*|0$", //正数(正整数 + 0)num2: "^-[1-9]\\d*|0$", //负数(负整数 + 0)ascii: "^[\\x00-\\xFF]+$", //仅ACSII字符chinese: "^[\\u4e00-\\u9fa5]+$", //仅中文color: "^[a-fA-F0-9]{6}$", //颜色date: "^\\d{4}(\\-|\\/|\.)\\d{1,2}\\1\\d{1,2}$", //日期email: "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$", //邮件idcard: "^[1-9]([0-9]{14}|[0-9]{17})$", //身份证ip4: "^(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)$", //ip地址letter: "^[A-Za-z]+$", //字母letter_l: "^[a-z]+$", //小写字母letter_u: "^[A-Z]+$", //大写字母mobile: "^0?(13|15|17|18|14)[0-9]{9}$", //手机notempty: "^\\S+$", //非空password: "^.*[A-Za-z0-9\\w_-]+.*$", //密码fullNumber: "^[0-9]+$", //数字picture: "(.*)\\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$", //图片qq: "^[1-9]*[1-9][0-9]*$", //QQ号码rar: "(.*)\\.(rar|zip|7zip|tgz)$", //压缩文件tel: "^[0-9\-()()]{7,18}$", //电话号码的函数(包括验证国内区号,国际区号,分机号)url: "^http[s]?:\\/\\/([\\w-]+\\.)+[\\w-]+([\\w-./?%&=]*)?$", //urlusername: "^[A-Za-z0-9_\\-\\u4e00-\\u9fa5]+$", //户名deptname: "^[A-Za-z0-9_()()\\-\\u4e00-\\u9fa5]+$", //单位名zipcode: "^\\d{6}$", //邮编realname: "^[A-Za-z\\u4e00-\\u9fa5]+$", // 真实姓名companyname: "^[A-Za-z0-9_()()\\-\\u4e00-\\u9fa5]+$",companyaddr: "^[A-Za-z0-9_()()\\#\\-\\u4e00-\\u9fa5]+$",companysite: "^http[s]?:\\/\\/([\\w-]+\\.)+[\\w-]+([\\w-./?%&#=]*)?$"
这篇关于东京商城注册页面使用的正则表达式......的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!