增加方法

This commit is contained in:
wanggeng 2022-08-20 23:43:51 +08:00
parent 7f977a5a4d
commit 846a274469

View File

@ -111,6 +111,10 @@ public class RegexUtil {
* 路径参数
*/
private static final Pattern PATH_PARAMS = Pattern.compile("\\{\\w+\\}");
/**
* 标准命名
*/
private static final Pattern STANDARD_NAME = Pattern.compile("^[a-zA-Z]+[\\d\\_]*", Pattern.CASE_INSENSITIVE);
/**
* 判断弱密码强度
@ -323,6 +327,16 @@ public class RegexUtil {
return customPattern.matcher(input).matches();
}
/**
* 是否标准命名字母开头包含数字和下划线
*
* @param input
* @return
*/
public static boolean isStandardName(String input) {
return STANDARD_NAME.matcher(input).matches();
}
/**
* 将路径中的参数替换为指定的字符返回替换后的结果
*