RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find ISO 8601 (W3 subset)
Expression
^(\d{4}((-)?(0[1-9]|1[0-2])((-)?(0[1-9]|[1-2][0-9]|3[0-1])(T(24:00(:00(\.[0]+)?)?|(([0-1][0-9]|2[0-3])(:)[0-5][0-9])((:)[0-5][0-9](\.[\d]+)?)?)((\+|-)(14:00|(0[0-9]|1[0-3])(:)[0-5][0-9])|Z))?)?)?)$
Description
Matches all valid date/datetime strings according to the W3's implementation of ISO 8601, outlined here: http://www.w3.org/TR/NOTE-datetime
Matches
2008, 2004-04-14, 1997-01-27T18:57Z, 2010-11-21T08:12:17.243+07:00
Non-Matches
3:00, 2/28/2003, 2010-14-21T08:12:17.243+07:00
Author Rating: Not yet rated. Ryan Bies
Source http://yaauie.com
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials