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

    邮箱验证:

    public static readonly string Email = @"^((([a-z]|d|[!#$%&'*+-/=?^_`{|}~]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])+(.([a-z]|d|[!#$%&'*+-/=?^_`{|}~]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])+)*)|((x22)((((x20|x09)*(x0dx0a))?(x20|x09)+)?(([x01-x08x0bx0cx0e-x1fx7f]|x21|[x23-x5b]|[x5d-x7e]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|(\([x01-x09x0bx0cx0d-x7f]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF]))))*(((x20|x09)*(x0dx0a))?(x20|x09)+)?(x22)))@((([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|(([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])([a-z]|d|-|.|_|~|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])*([a-z]|d|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF]))).)+(([a-z]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])|(([a-z]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])([a-z]|d|-|.|_|~|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])*([a-z]|[u00A0-uD7FFuF900-uFDCFuFDF0-uFFEF])))$";

    public static readonly string IdString = "^\d+(,\d+)*$";

    public static readonly string Account = @"^([a-zA-Z0-9@._])+$";

    public static readonly string Password = @"^([a-zA-Z0-9]|[!#$%&'*+-/=?^_`{|}~]){6,20}$";

    public static readonly string Tel = @"^1[0-9]{10}$";

    public static readonly string Guid = @"^[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}$";

    //QQ号验证
    public static readonly string qq = @"^[1-9][0-9]{4,14}$";
    //身份证号验证(18位)^d{17}(?:d|X|x)$
    //public static readonly string isCard = @"^[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{3}([0-9]|X)$";
    public static readonly string isCard = @"^[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{3}([0-9]|X|x)$";
    //邮箱验证(用于前台JS)
    public static readonly string JsEmail = @"^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$ ";
    //微信验证
    public static readonly string WeiXin = @"[a-zA-Z][-_a-zA-Z0-9]{5,19}";

  • 相关阅读:
    JVM垃圾收集器-Parallel Scavenge收集器
    JVM垃圾收集器-ParNew收集器
    JVM垃圾收集器-Serial收集器
    UCloud数据盘扩容步骤
    java中强引用、软引用、弱引用、幻象引用有什么区别?分别使用在什么场景?
    java中exception和error有什么区别,运行时异常和一般异常有什么区别
    maven中的坐标和仓库
    Maven常用的构建命令
    Maven学习
    【设计原则和编程技巧】单一职责原则 (Single Responsibility Principle, SRP)
  • 原文地址:https://www.cnblogs.com/zhudezhiwansui/p/8960769.html
Copyright © 2011-2022 走看看