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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Valid Date
Expression
(?:(?:(?:04|06|09|11)\/(?:(?:[012][0-9])|30))|(?:(?:(?:0[135789])|(?:1[02]))\/(?:(?:[012][0-9])|30|31))|(?:02\/(?:[012][0-9])))\/(?:19|20|21)[0-9][0-9]
Description
Matches dates in mm/dd/yyyy format. Matches only valid dates -except is unable to test for a leapyear. Always allows February 29th. Allows years from 1901 to 2199.
Matches
02/21/1972 | 12/31/2199 | 09/04/1901
Non-Matches
02/31/1999 | 02-21-1972 | 06/31/2001
Author Rating: Not yet rated. John Moore
Source
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

Title: format dd/MM/yyyy
Name: avi mic
Date: 6/16/2011 4:15:02 AM
Comment:
(?:(?:(?:(?:0[1-9]|[12][0-9])|30))\/(?:04|06|09|11)|(?:(?:(?:0[135789])|(?:1[02]))\/(?:(?:0[1-9]|[12][0-9])|30|31))|(?:0[1-9]|[12][0-9])\/(?:02))\/(?:19|20|21)[0-9][0-9] --dd/MM/yyyy-


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