时间格式(00:00-24:00)
public static boolean timeCheck(String time){
Pattern pattern = Pattern.compile("((((0?[0-9])|([1][0-9])|([2][0-4]))\\:([0-5]?[0-9])))?$");
boolean check = pattern.matcher(time).matches();
return check;
}
网友评论