Title: Thanks, but...
Name: havax
Date: 7/17/2009 6:21:48 PM
Comment:
This works perfectly except for one thing. You only include 1,3,5,7,8,11 and 12 as valid months. if you add 2,4,6 and 9 into the beginning for both leading zeros and non leading zeros it works fine.
Title: Thanks, but...
Name: havax
Date: 7/17/2009 6:21:29 PM
Comment:
This works perfectly except for one thing. You only include 1,3,5,7,8,11 and 12 as valid months. if you add 2,4,6 and 9 into the beginning for both leading zeros and non leading zeros it works fine.
Title: Thanks
Name: Neil
Date: 9/17/2007 11:17:49 PM
Comment:
Thanks for your post, I am looking forwart this for a long time.
Title: Thanks
Name: iamtgo3
Date: 8/23/2007 12:10:10 PM
Comment:
Great regex. This is exacly what I have been looking for. Please keep me updated if you do the leap year part. This works great.
Title: Thanks
Name: Michael
Date: 1/20/2007 8:09:06 AM
Comment:
Thanks for the post
Title: hmmm
Name: Brian
Date: 12/13/2005 10:59:36 AM
Comment:
This string results in a match
01010006
is there any way to get this to require a date after say after 1900 ?
Title: Leading zeros work for ALL months using the regex given by Charley
Name: srivalli chavali
Date: 10/18/2005 6:54:13 PM
Comment:
Leading zeros work for ALL months using the regex given by Charley
[
Title: Oops, this is the one that works
Name: Charley
Date: 9/2/2003 2:45:06 PM
Comment:
This one fixes the leading zeros and also the 11th hour problems with Scott's regex.
^(((((0?[13578])|(1[0-2]))[\-\/\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]))))[\-\/\s]?\d{4})(\s(((0?[1-9])|(1[0-
2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$
]
Title: Good one but doesn't match leading zeros in some months
Name: srivalli chavali
Date: 10/18/2005 6:39:01 PM
Comment:
This is very helpful.
But it does not match 09/09/2005.
That is, it does not match leading zeros in some months(04,06,09)
I think it should be fixed.
Title: Works great in C# Regular Expression
Name: Joe Krauss
Date: 5/28/2005 9:58:14 PM
Comment:
Thanks David for taking the time to build this expression and post it. The expression works perfect in the C# application I'm working on.
Thanks again!
Title: Oops, this is the one that works
Name: Charley
Date: 9/2/2003 2:45:06 PM
Comment:
This one fixes the leading zeros and also the 11th hour problems with Scott's regex.
^(((((0?[13578])|(1[0-2]))[\-\/\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]))))[\-\/\s]?\d{4})(\s(((0?[1-9])|(1[0-2]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$
Title: This doesn't work for leading zeros
Name: Charley
Date: 9/2/2003 2:40:27 PM
Comment:
Here is a regex for SQL Server dates that will account for leading zeros on the month, day and hour.
^(((((0?[13578])|(1[0-2]))[\-\/\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]))))[\-\/\s]?\d{4})(\s(((0?[1-9])|(1[02]))\:([0-5][0-9])((\s)|(\:([0-5][0-9])\s))([AM|PM|am|pm]{2,2})))?$