Regex calendar validation
问题 I am trying to make a program where the user enters a date(any date), for example 29-Jul-1995 . The program should match the date format and validate if this date is correct or not. Here is my code: import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Review1_Main { public static Pattern pattern; public static Matcher matcher; // DATE_PATTERN is a format for user input private static final Pattern DATE_PATTERN = Pattern.compile("(0?[1-9]|[12][0-9]|3