Title |
Test
Find
DateTime
|
Expression |
^([0]\d|[1][0-2]\/([0-2]\d|[3][0-1])\/([2][0]\d{2})\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d)?\s(AM|am|aM|Am|PM|pm|pM|Pm) |
Description |
Date Time with am/pm. |
Matches |
10/13/2008 12:00:00 AM, 10/13/2008 12:00:00 PM |
Non-Matches |
10/13/2008 12:00:00 |
Author |
Rating:
Yaron
|
Source |
|
Your Rating |
|
Title: Question Mark might be out of place?
Name: JohnCannon.IT
Date: 12/12/2014 10:28:32 AM
Comment:
It looks like the open parenthesis at the second character and the close parenthesis just before the ? are paired. Based on that, doesn't it mean everything before the AM/PM stuff is optional? I think if you modify if as below, it makes all the time optional, and still allows the date:
^[0]\d|[1][0-2]\/([0-2]\d|[3][0-1])\/([2][0]\d{2})(\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d\s(AM|am|aM|Am|PM|pm|pM|Pm))?
There are probably better ways to do this.
Title: Allows invalid date
Name: Michael Ash
Date: 12/8/2008 11:15:34 AM
Comment:
Allows invalid date values like 00/00/2000