zoukankan      html  css  js  c++  java
  • 常用正则

    // 邮编格式验证、验证码格式验证
    this.zipCodeTest = /^d{6}$/
    // 1-100正整数
    this.positiveIntegerTest = /^d{1,3}$/
    // 座机格式验证
    this.landlineAreaCodeTest = /^(d{3,4})$/
    this.landlinePhoneCodeTest = /^d{7,8}$/
    // 根据工信部2019年最新公布的手机号段 后面是港澳台
    this.phoneNumberTest = /^1((3[d])|(4[5,6,7,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[d])|(9[1,5,8,9]))d{8}$|^0085[23]d{8}$|^00886d{9}$/
    // 邮箱格式验证
    this.emailTest = /^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
    // 身份证号码验证 code==01
    this.idNoTest = /(^d{15}$)|(^d{18}$)|(^d{17}(d|X|x)$)/
    // 6-25个数字字母 其他证件号码
    this.otherNoTest = /^[da-zA-Zu4E00-u9FA5]{6,25}$/
    // 出生证10个字符,1个大写字母+9个数字 code==13
    this.BirthIdTest = /^([A-Z])(d{9})$/
    // 4-8个数字字母 警官证code==16
    this.JgzTest = /^[da-zA-Zu4E00-u9FA5]{4,8}$/
    // 港澳台 code==17
    this.HKzTest = /^[da-zA-Zu4E00-u9FA5]{18}$/
    // 姓名校验英文
    // this.enNameTest = /^[A-Za-z][A-Za-zs]*[A-Za-z]$/
    this.enNameTest = /^[A-Za-z][A-Za-zs(-)]*[A-Za-z]$/
    // 中文包括少数民族 【u4dae】䶮
    // eslint-disable-next-line no-useless-escape
    this.chNameTest = /^[u4E00-u9FA5][u4E00-u9FA5(·|•)|u4dae]*[u4E00-u9FA5|u4dae]$/
    // this.chNameTest = /^[u4E00-u9FA5][u4E00-u9FA5(·|•)]*[u4E00-u9FA5]$/
  • 相关阅读:
    js实现两种实用的排序算法——冒泡、快速排序
    node端代理浏览器路由 解决浏览器跨域问题
    HTTP Request header
    移动H5前端性能优化指南
    express下使用ES6
    Nginx Location配置总结
    NODE_ENV=production 环境变量设置
    css3逐帧动画
    js scheme 打开手机app的方法
    jQuery hashchange监听浏览器url变化
  • 原文地址:https://www.cnblogs.com/gongxiaoyan/p/13576118.html
Copyright © 2011-2022 走看看