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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Current Century Date
Expression
^([0-1]?[0-9]{1}/[0-3]?[0-9]{1}/20[0-9]{2})$
Description
This regular expression will validate most (current & future) date options. The weaknesses with this one is that it will allow the days to go up to 39 and does not account for leap year. Also, the months can go up to 19, instead of our commonly accepted 12 month year. :) I designed this expression to validate dates from the year 2000 to 2099. I do not plan on this same code being in place in 2099, so I hope this is sufficient enough...
Matches
2/14/2001 | 12/29/2099 | 19/39/2000
Non-Matches
12/29/1999 | 20/40/2100
Author Rating: The rating for this expression. The Mighty Will
Source http://hismightiness.blogspot.com/2007/04/regular-expression-date.html
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