新增路径判断方法
This commit is contained in:
parent
e52a7f25c4
commit
2f4b2ea77a
@ -36,9 +36,13 @@ public class RegexUtil {
|
||||
*/
|
||||
private static final Pattern PATTERN_EMAIL = Pattern.compile("^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$");
|
||||
/**
|
||||
* 邮箱
|
||||
* URL
|
||||
*/
|
||||
private static final Pattern PATTERN_URL = Pattern.compile("(^#)|(^http(s*):\\/\\/[^\\s]+)");
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private static final Pattern PATTERN_PATH = Pattern.compile("\\/[^\\s]*");
|
||||
/**
|
||||
* 日期格式
|
||||
*/
|
||||
@ -164,6 +168,16 @@ public class RegexUtil {
|
||||
return PATTERN_URL.matcher(input).matches();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断PATH
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
||||
public static boolean isPath(String input) {
|
||||
return PATTERN_PATH.matcher(input).matches();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断日期
|
||||
*
|
||||
@ -311,8 +325,4 @@ public class RegexUtil {
|
||||
return path;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(isHhMmSs("1111111"));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user