日期格式为“YYYYMM”的正则表达式
public static boolean verifyYYYYMM(String date){
String regex = "^(20|19){1}[0-9]{2}(((0){1}[1-9]{1})|((1){1}(0|1|2){1}))$";
boolean matches = Pattern.matches(regex, date);
System.out.println(matches);
return matches;
}

浙公网安备 33010602011771号