博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Java正则表达式的用法
阅读量:2386 次
发布时间:2019-05-10

本文共 809 字,大约阅读时间需要 2 分钟。

/**  * 校验时间格式,正确则返回true  * @param xxx  * @return  */
private static boolean checkDateFormat (String xxx) {
String correctDateFormat = "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s((([0-1][0-9])|(2?[0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$"; boolean result = Pattern.matches(correctDateFormat, xxx); return result; }

 

posted @
2017-06-29 20:12 阅读(
...) 评论(
...)

转载地址:http://ukjab.baihongyu.com/

你可能感兴趣的文章
Detecting Kippo SSH honeypots, bypassing patches, and all that jazz.
查看>>
WebLogic SSRF And XSS (CVE-2014-4241, CVE-2014-4210, CVE-2014-4242)
查看>>
威胁情报 应急响应 以及 恶意软件分析资料
查看>>
Investigating with Network-based Evidence
查看>>
malware anti-sandbox
查看>>
nmon分析工具
查看>>
Mysql Explain 详解[强烈推荐]
查看>>
MySQL的性能调优工具
查看>>
对apache中并发控制参数prefork理解和调优
查看>>
IE plugins/tools for pen-testers
查看>>
开源的web防火墙
查看>>
bind+dlz+mysql实现区域记录动态更新
查看>>
爬山注意事项
查看>>
入侵响应工具包
查看>>
cacti + nagios + ndoutility + nagvis安装及配置
查看>>
GrokEVT – Read Windows NT/2K/XP/2K3 event logs
查看>>
国内博客(blog)搬家工具(服务)大全
查看>>
用 SuSE Linux Rescue Mode 恢复超级用户口令
查看>>
杭州2015上学政策
查看>>
“Cache-control”常见的取值有private、no-cache、max-age、must-revalidate
查看>>