package com.njcn.pojo.commons;


import org.apache.kafka.common.protocol.types.Field;

/**
 * @author hongawen
 * @Date: 2018/8/9 11:40
 * 正则表达式实体
 */
public class PatternRegex {
    //url以/开头，只包含字母，不以/结尾
    public final static String URL_REGEX ="^([/]([A-Za-z0-9]|/)*[^/])|#$";

    //密码需要包含特殊字符字母数字，长度为8-16
    public final static String Password_REGEX = "^(?=.*[a-zA-Z])(?=.*\\d)(?=.*[@#_!$%^&*()?<>/|~,\\-+.]).{8,16}$";


    //手机的密码
    public final static String Password_PHONE_REGEX = "^.{6,18}$";

    //用户名中文1-16
    public final static String NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,16}$";

    //登录名只能输入3-16位的英文字母和数字
    public final static String USERNAME_REGEX = "^[a-zA-Z_]{1}[a-zA-Z0-9_]{2,15}$";

    //手机号必须有11位，并且为数字，是正常的手机·号码开头
    public final static String PHONE_REGEX = "^1(1|2|3|4|5|6|7|8|9)\\d{9}$";

    //邮箱含有@ .在@后，以.com、.con结尾（qq,163等）
    public final static String Email_REGEX = "^([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+\\.(?:com|cn)$";

    //ip地址
    public final static String ip_REGEX = "^(2[5][0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})$";

    //角色名由数字、字母组成且长度为2-50
    public final static String ROLE_REGEX = "^[a-zA-Z][a-zA-Z0-9]{2,50}$";

    //部门名称由汉字组成，长度为0-20
    public final static String DEPTS_REGEX = "^[\\u4e00-\\u9fa5]{1,50}$";

    //字典名称包括中文、数字、字母、括号以及点号
    public final static String DIC_REGEX = "^[\\w\\u4E00-\\u9FA5()（）_/、\\- ]+\\.?[\\w\\u4E00-\\u9FA5()（）I II III IV V /]{0,125}$";

    //密码有效期（月）1-3月
    public final static String PASSMONTH_REGEX = "^[1-3]{1}$";

    //密码错误次数 1-10次
    public final static String PASSERROR_REGEX = "^([1-9]|10)$";

    //最大并发数 1-99次
    public final static String MAXNUM_REGEX = "^([1-9]{1}|[0-9]{2})$";

    //闲置用户_修改密码 6-12
    public final static String PASSUPW_REGEX = "^([6-9]{1}|10|11|12)$";

    //临时账户休眠 1-12
    public final static String FREEMONTH_REGEX = "^([1-9]{1}|10|11|12)$";

    //审计存储空间 1-2G
    public final static String LOGSIZE_REGEX = "^[1-2]{1}$";

    //用户锁定时长20-60min
    public final static String USERLOCK_REGEX = "^[2-5][0-9]|60$";

    //台账名称
    public final static String  devname_REGEX = "[\\±\\+\\-\\u4E00-\\u9FA5A-Za-z0-9_\\s+\\#\\-\\Ⅰ\\Ⅱ\\Ⅲ\\Ⅳ\\Ⅴ\\Ⅵ\\Ⅶ\\Ⅷ]{1,64}$";

    //浮点数
    public final static String float_REGEX = "[0-9]*(\\.?)[0-9]*";

    //识别码秘钥
    public final static String series_REGEX = "[^\\u4e00-\\u9fa5]{0,20}$";


    //ip分段
    public final static String sip_REGEX = "[0-9]{1,3}$";

    //端口号
    public final static String port_REGEX = "[0-9]{1,10}$";

    //备注
    public final static String remark_REGEX = "[\\u4E00-\\u9FA5A-Za-z0-9_]{0,255}$";

    //国网平台监测点号
    public final static String monitorid_REGEX = "[A-Za-z0-9]{0,255}$";

    //变压器名称
    public final static String TRANSNAME_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,50}$";

    //变压器策略名称
    public final static String TFNAME_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,16}$";

    //字典类型名称
    public final static String TYPE_REGEX = "^[0-9a-zA-Z\\u0391-\\uFFE5]{1,100}$";

    //描述64
    public final static String DES64_REGEX = "^.{0,64}$";

    //描述200
    public final static String DES200_REGEX = "^.{0,200}$";

    //描述500
    public final static String DES500_REGEX = "^.{0,500}$";

    //mac地址
    public final static String MAC_REGEX = "^([0-9a-fA-F]{2})(([/\\s:-][0-9a-fA-F]{2}){5})$";

    //流量套餐
    public final static String DATAPLAN_REGEX = "[0-9]{0,6}$";

    //十六进制颜色
    public final static String COLOR_REGEX = "^#([a-fA-F\\d]{3}|[a-fA-F\\d]{6})$";

    //描述64
    public final static String DES10_REGEX = "^.{1,10}$";

    //正整数
    public final static String ZHENG_REGEX = "^\\+?[1-9][0-9]*$";
}
