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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((0?[13578]|10|12)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[01]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1}))|(0?[2469]|11)(-|\/)(([1-9])|(0[1-9])|([12])([0-9]?)|(3[0]?))(-|\/)((19)([2-9])(\d{1})|(20)([01])(\d{1})|([8901])(\d{1})))$
Description
improved date validation M/D/YY or M/D/YYYY or MM/DD/YYYY or MM/DD/YY: 1/1/1920 through 12/31/2019; Feb 29 and 30 always allowed, deal with it
Matches
1/2/03 | 02/30/1999 | 3/04/00
Non-Matches
3/4/2020 | 3/4/1919 | 4/31/2000
Author Rating: The rating for this expression. Brad Williams
Source Modification of regexp_id=84
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: Allow Year 2020 for all month date
Name: Rahul
Date: 5/26/2020 8:36:44 AM
Comment:
Dear Team , above given date format expression is not taking 1/1/2020 and after date it is taking only till 12/31/2019 .how to allow 2020 year date.


Title: Allow Year 2020 for all month date
Name: Rahul
Date: 5/26/2020 8:34:13 AM
Comment:
Dear Team , above given date format expression is not taking 1/1/2020 and after date it is taking only till 12/31/2019 .how to allow 2020 year date.


Title: Allow Year 2020 for all month date
Name: Rahul
Date: 5/26/2020 8:02:50 AM
Comment:
Dear Team , above given date format expression is not taking 1/1/2020 and after date it is taking only till 12/31/2019 .how to allow 2020 year date.


Title: Allow Year 2020 for all month date
Name: Rahul
Date: 5/26/2020 8:01:35 AM
Comment:
Dear Team , above given date format expression is not taking 1/1/2020 and after date it is taking only till 12/31/2019 .how to allow 2020 year date.


Title: remove year limit
Name: Corey
Date: 1/23/2015 2:01:21 PM
Comment:
How can I remove the year limits on this?


Title: LeapYear
Name: Murali
Date: 1/31/2007 5:54:19 AM
Comment:
This expression allows 29,30 in february. regardless of leapyear


Title: improved
Name: Brad
Date: 3/28/2004 5:01:46 PM
Comment:
Okay, I've improved it so that it handles single digit days and months all the time.


Title: no error
Name: Brad
Date: 3/15/2004 1:57:31 AM
Comment:
Yes, m/d/yyyy will NOT work for this, see the description.


Title: error
Name: rico
Date: 2/4/2004 10:26:28 AM
Comment:
I'was using your expression and while testing it on the date 2/4/2004 (m/d/yyyy)and a few other dates it does not match I even tested it in www.regexlib.com and still no match. just toought I'd let you know Thanx Rico


Title: Developer
Name: THulsey
Date: 1/9/2004 11:48:29 AM
Comment:
Good workie. Not too verbose.


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