package com.zanxiang.game.module.sdk.constant;

/**
 * @author : lingfeng
 * @time : 2022-10-08
 * @description : 正则表达式
 */
public class RegexConstant {

    /**
     * 正则：手机号
     */
    public static final String REGEX_MOBILE_EXACT = "^[1][3,4,5,6,7,8,9][0-9]{9}$";

    /**
     * 正则：中文姓名
     */
    public static final String REGEX_CHINESE_NAME = "[\\u4E00-\\u9FA5]{2,5}(?:·[\\u4E00-\\u9FA5]{2,5})*";

    /**
     * 正则：身份证号码15位
     */
    public static final String REGEX_ID_CARD15 = "^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$";

    /**
     * 正则：身份证号码18位
     */
    public static final String REGEX_ID_CARD18 = "^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9Xx])$";

    /**
     * 正则：用户名，取值范围为a-z,A-Z,0-9，必须是6-20位
     */
    public static final String REGEX_USER_NAME = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{4,32}$";

    /**
     * 正则：密码，取值范围为a-z,A-Z,0-9，必须是6-20位
     */
    public static final String REGEX_PASSWORD = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,32}$";

    /**
     * 正则：邮箱
     */
    public static final String REGEX_EMAIL = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";

    /**
     * 正则：URL
     */
    public static final String REGEX_URL = "[a-zA-z]+://[^\\s]*";

    /**
     * 正则：汉字
     */
    public static final String REGEX_ZH = "^[\\u4e00-\\u9fa5]+$";

    /**
     * 正则：中国邮政编码
     */
    public static final String REGEX_ZIP_CODE = "[1-9]\\d{5}(?!\\d)";


}
