切记,只能在java中使用,支持 yyyy-MM-dd、yyy-MM-dd、yy-MM-dd 和 y-MM-dd ,范围 1~9999 年
public boolean isJudgeDate(String dateString){
String eL = "(?:[0-9]{1,4}(?<!^0?0?0?0))-(?:0?[1-9]|1[0-2])-(?:0?[1-9]|1[0-9]|2[0-8]|(?:(?<=-(?:0?[13578]|1[02])-)(?:29|3[01]))|(?:(?<=-(?:0?[469]|11)-)(?:29|30))|(?:(?<=(?:(?:[0-9]{0,2}(?!0?0)(?:[02468]?(?<![13579])[048]|[13579][26]))|(?:(?:[02468]?[048]|[13579][26])00))-0?2-)(?:29)))";
Pattern p = Pattern.compile(eL);
Matcher m = p.matcher(dateString);
boolean b = m.matches();
return b;
}