Regular Expression -Date:MM/dd/yyyy,M/dd/yyyy
2007-09-19 08:04
351 查看
Regular Expression Details
[Find] [Test] | ||
Title | Pattern Title | |
Pattern | ^(((((0[13578])|([13578])|(1[02]))[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9])|(3[01])))|((([469])|(11))[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9])|(30)))|((02|2)[\-\/\s]?((0[1-9])|([1-9])|([1-2][0-9]))))[\-\/\s]?\d{4})(\s(((0[1-9])|([1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$ | |
Author | David Darling | |
Matching Text | 11/30/2003 10:12:24 am|||2/29/2003 08:14:56 pm|||5/22/2003 | |
Non-Matching Text | 11/31/2003 10:12:24 am|||2/30/2003 08:14:56 pm|||5/22/2003 14:15 | |
Description | Following expression can be used to validate a datetime column from SQL Server. This expression is an enhanced version of Scott Watermasysk's date/time submission. It now accepts leading zeros in months, days, and hours. In addition, this expression properly handles the 11th hour. Watermasysk's would take the 10th and 12th hour but not the 11th. This regex has been tweaked to do so. Does not handle the February 29th problem on non-leap years yet. Will learn a little more about RegEx and do so in later submission. | |
Source |
相关文章推荐
- java将 Date原始格式EEE MMM dd HH:mm:ss Z yyyy"转成指定格式
- json中string类型的datetime格式转换为datetime类型:例string类型"/Date(1242357713797+0800)/" 转为datetime类型"yyyy-MM-dd"
- java中如何将String类型的日期格式为yyyyMMdd转化为date类型的yyyy-MM-dd格式
- 如何将extjs 传过来的 “yyyy-mm-dd” String类型 在后端转化为 Date
- 在EL表达式或者Struts标签库中格式化日期对象,即将Date转换为yyyy-MM-dd格式
- js 字符串日期 yyyy-MM-dd 转化为 date
- <fmt:formatDate value="${ abc}" pattern="hh:mma, MM/dd/yyyy" /> jstl 时间data格式
- JavaWeb学习笔记 日期转换 如何将yyyy-MM-dd已Date类型返回 前篇 未完全解决
- 原生jsDate()时间转换为yyyy-MM-dd 时:分:秒的格式
- date类型转成yyyy-MM-dd格式的Date类型
- to_date(to_char(sysdate,'YYYY-MM-DD ')
- el-date-picker 日期格式化 yyyy-MM-dd
- Regular Expression -Date:MM/dd/yyyy,M/dd/yyyy
- 如何把java.util.date的日期格式变为yyyy-MM-dd格式
- javascript date 验证yyyy/MM/dd yyyy-MM-dd
- js 字符串日期 yyyy-MM-dd 转化为 date
- js 字符串日期 yyyy-MM-dd 转化为 date
- Java 中返回yyyy-MM-dd类型的Date
- 使用js把 java date类型转换yyyy-MM-dd
- NSDateFormatter的dateFormat必须yyyy-MM-dd