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

    
    //验证0-99两位小数点的数字
    
    rg100 = /^((d{1,2}(.d{1,2})?))$/
    
     stringNumber = /^[0-9]*$/
    
     normalNumber = /^d+(.d+)?$/
    
     account = /^[a-zA-Z0-9_-]{4,}$/
    
     cellPhone = /^1[3456789]d{9}$/
    
     complexPassword = /^.*(?=.{6,})(?=.*d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/
    
     simplePassword = /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)]|[()])+$)([^(0-9a-zA-Z)]|[()]|[a-z]|[A-Z]|[0-9]){6,}$/
    
     qq = /^[a-zA-Z0-9_-]{4,16}$/
    
     dictTypeCode = /^[0-9a-zA-Z_]{1,10}$/
    
     dictOther = /^[sS]{1,30}$/
    
     dictNum = /^[0-9]{1,3}$/
    
     paramsOther = /^[sS]{1,50}$/
    
     vehicleNumber = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4,5}[A-Z0-9挂学警港澳]{1}$/
    
     telPhone = /^((0d{2,3})-?)(d{7,8})(-(d{3,}))?$/
    
     positiveInteger = /^[1-9]{1,}[d]*$/
    
     price = /^(0|([1-9][0-9]*))(.d{1,2})?$/
    
     email = /^[A-Za-z0-9u4e00-u9fa5]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/
    
     percent = /^((d{1,2}(.d{1,2})?)|100)$/
    
     bigPrice = /^([1-9][0-9]*)(.d{1,2})?$/
    
     postCode = /^d{6}$/
    
    //  IdNo = /^(^[1-9]d{7}((0d)|(1[0-2]))(([0|1|2]d)|3[0-1])d{3}$)|(^[1-9]d{5}[1-9]d{3}((0d)|(1[0-2]))(([0|1|2]d)|3[0-1])((d{4})|d{3}[Xx])$)$/
     IdNo = /(^d{15}$)|(^d{18}$)|(^d{17}(d|X|x)$)/
    
     orgCode = /^[a-zA-Z0-9]{8}-[a-zA-Z0-9]$/
    
     bankCard = /^([1-9]{1})(d{14}|d{15}|d{18})$/
    
     zhengzhengshu = /^(?:(?!0)d{1,6}|10{6})$/
    
    //特殊字符
     regEn = /^[`!@#$%^&*()+<>?:"{},/;'[]]*$/
    
     regCn = /^[·!#¥(——):;“”‘、,|《。》?、【】[]]*$/
    
     regSpec = /[`!@#$%^&*()+=<>?:"{}|,./;'\[]·~!@#¥%……&*()——+={}|《》?:“”【】、;‘’,。、]/im
    
  • 相关阅读:
    2.WSDL 文档
    SQL SERVER取分组数据第一条:查出每个班级的成绩第一名
    生成随机字符串
    js返回上一页并刷新的几种方法
    SQL 单表查询多个计算的值
    SQL 从字符串中提取数字
    SQL 视图和表
    WebSrevice (2)
    WebSrevice (1)
    CSS中如何选择ul下li的奇数、偶数行
  • 原文地址:https://www.cnblogs.com/calamus/p/10641852.html
Copyright © 2011-2022 走看看