Merge branch '1.0.x' into dev

This commit is contained in:
2023-03-29 23:48:44 +08:00
15 changed files with 105 additions and 29 deletions

View File

@@ -19,6 +19,8 @@ package top.charles7c.cnadmin.common.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import cn.hutool.core.lang.RegexPool;
/**
* 正则相关常量
*
@@ -26,10 +28,25 @@ import lombok.NoArgsConstructor;
* @since 2023/1/10 20:06
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class RegExpConsts {
public class RegexConsts implements RegexPool {
/**
* 密码正则必须包含字母和数字的组合可以使用特殊字符长度在6-32之间
* 用户名正则长度为 4 16 可以包含字母数字下划线以字母开头
*/
public static final String USERNAME = "^[a-zA-Z][a-zA-Z0-9_]{3,15}$";
/**
* 密码正则长度为 6 32 可以包含字母数字下划线特殊字符同时包含字母和数字
*/
public static final String PASSWORD = "^(?=.*\\d)(?=.*[a-z]).{6,32}$";
/**
* 通用编码正则长度为 2 16 可以包含字母数字下划线以字母开头
*/
public static final String GENERAL_CODE = "^[a-zA-Z][a-zA-Z0-9_]{1,15}$";
/**
* 通用名称正则长度为 1 20 可以包含中文字母数字下划线短横线
*/
public static final String GENERAL_NAME = "^[\\u4e00-\\u9fa5a-zA-Z0-9_-]{1,20}$";
}