Hi, How can I check if date for Feb month is valid? I tried the below program but for input 02/31/2100, I get the valid result. public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); String inputStr = "02 /31/ 2100"; inputStr = inputStr.replaceAll("\\s", ""); String exp = "^(0?[1-9]|1[012])[-/]?(0?[1-9]|[12][0-9]|3[01])[-/]?(19[\\d]{2}|20[\\d]{2}|2100)$"; Pattern pattern = Pattern.compile(exp,Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(inputStr); if(matcher.matches()) { ...