日期格式为“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; }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM