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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Date Dashes Two Digit Year
Expression
^((((0?[13578])|(1[02]))[\-]?((0?[1-9]|[0-2][0-9])|(3[01])))|(((0?[469])|(11))[\-]?((0?[1-9]|[0-2][0-9])|(30)))|(0?[2][\-]?(0?[1-9]|[0-2][0-9])))[\-]?\d{2}$
Description
I was looking for a date format that allowed 1 or 2 digit Month and Days and 2 digit years. I found and tweak this one based off Cliff Schneide Date example.
Matches
03-25-08|3-25-08|3-1-08
Non-Matches
03-25-2008|3-25-2008|3/25/2008
Author Rating: The rating for this expression. George Goehring
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

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