增加方法
This commit is contained in:
parent
7f977a5a4d
commit
846a274469
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将路径中的参数替换为指定的字符,返回替换后的结果
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user