- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find mm/dd/yyyy hh:MM DateTime, time obligatory
Based on Michael Ash's expression. This regex will validate only datetime, not only date or only time. Dates are in the DD/MM/YYYY HH:mm format and validated for months, number of days in a month and leap years (29/2) Date field can be separated by matched periods(.), dashes(-) or forward slashes(/). Year range 1900-9999 Time is in 24 hour military format (HH:mm:SS), from 00:00:00 to 23:59:59, where hours and minutes fields are required, including leading 0 for hours less than 10. Datetime is the above date and time formats separated by a space, with the date first (DD/MM/YYYY HH:mm) !IMPORTANT NOTE: your regex engine must support lookaheads and named groups to use this expression
1/31/2002 10:59 | 2/29/2004 11:03
1/32/2002 10:59 | 2/29/2003 11:03
Author Rating: The rating for this expression. Wouter Hibma
Source Wouter Hibma
Your Rating
Bad Good

Enter New 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-2018, | ASP.NET Tutorials