Title |
Test
Find
Full ISO8601 DateTime
|
Expression |
\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([0-1][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])(?:.\d{7})?[+|-](0[0-9]|1[0-2]):(00|15|30|45) |
Description |
Complete date-time format according to the ISO 8601 standard. |
Matches |
2004-10-31T22:06:00+12:00 | 2006-04-31T12:31:39.6230000+05:45 | 2009-01-08T20:25:26-03:00 |
Non-Matches |
2009-01-09T12:23:34 | 2009-01-09 17:45:22 | 2009-05-32T12:67:23-15:00 | 2009-13-32T25:76:23 |
Author |
Rating:
Not yet rated.
Otavio
|
Source |
|
Your Rating |
|
Title: Thanks, a god regex
Name: Boris
Date: 3/21/2012 9:19:27 AM
Comment:
This Regex dont match this: 2002-02-10T21:01:29.250Z
for matching this i adapt the expression at the second-float and add the Z for Zulu-Time. My Expression is:
\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([0-1][0-9]|2[0-3]):([0-5][0-9]):((?:[0-5][0-9])(?:.\d*)?)(Z|([+|-])(0[0-9]|1[0-2]):(00|15|30|45))
It give you "Z" or the time e.g. "+1:00" an in case of a time the segments of the timezone