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])|([13578])|(1[02]))[\/](([1-9])|([0-2][0-9])|(3[01])))|(((0[469])|([469])|(11))[\/](([1-9])|([0-2][0-9])|(30)))|((2|02)[\/](([1-9])|([0-2][0-9]))))[\/]\d{4}$|^\d{4}$
Description
The following validates dates with and without leading zeros in the following formats: MM/DD/YYYY and it also takes YYYY (this can easily be removed). All months are validated for the correct number of days for that particular month except for February which can be set to 29 days. date day month year
Matches
01/01/2001 | 1/01/2001 | 2002
Non-Matches
2/30/2002 | 13/23/2002 | 12345
Author Rating: Not yet rated. Matt Adams
Source Started with http://regexlib.com/REDetails.aspx?regexp_id=106
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: fsdfsdf
Name: adam edmunds
Date: 2/14/2019 9:39:53 AM
Comment:
dz


Title: fsdfsdf
Name: adam edmunds
Date: 2/14/2019 9:39:48 AM
Comment:
dz


Title: fsdfsdf
Name: adam edmunds
Date: 2/14/2019 9:39:39 AM
Comment:
dz


Title: Pattern not working for basic case
Name: Yogesh
Date: 8/9/2016 9:26:40 AM
Comment:
this is not working 01/01/2001


Title: To refuse xx/00/xxxx
Name: Assami
Date: 10/24/2014 5:36:03 AM
Comment:
Replace the severals : ([0-2][0-9]) By : (0[1-9])|([12][0-9])


Title: To refuse xx/00/xxxx
Name: Assami
Date: 10/24/2014 5:33:30 AM
Comment:
Replace the severals : ([0-2][0-9]) By : (0[1-9])|([12][0-9])


Title: To refuse xx/00/xxxx
Name: Assami
Date: 10/24/2014 5:15:25 AM
Comment:
Replace the severals : ([0-2][0-9]) By : (0[1-9])|([12][0-9])


Title: To refuse xx/00/xxxx
Name: Assami
Date: 10/24/2014 5:11:43 AM
Comment:
Replace the severals : ([0-2][0-9]) By : (0[1-9])|([12][0-9])


Title: To refuse xx/00/xxxx
Name: Assami
Date: 10/24/2014 5:09:51 AM
Comment:
Replace the severals : ([0-2][0-9]) By : (0[1-9])|([12][0-9])


Title: Does not pass 01/00/2006.
Name: SUBBU
Date: 5/18/2014 12:35:34 AM
Comment:
This Expression is validating 01/00/2014 true..it's an error


Title: Does not pass 01/00/2006.
Name: tester
Date: 12/18/2009 7:06:52 PM
Comment:
01/00/2006?


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