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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Date Matching Regex
Expression
^\d?\d([./-])\d?\d\1(?:\d\d|\d{4})$
Description
Here's a super simple one for checking dates written numerically, MM/DD/YYYY. Separators can be "/", "-", or "." and must be the same. Because of it's simplicity it will allow dates that don't exist but that doesn't matter if you're looking for a basic date format checker and like to keep it simple.
Matches
1/2/14 | 01-02-2014 | 1.20.14
Non-Matches
1/2/014 | 1-2.2014 | Jan.2, 2014
Author Rating: Not yet rated. tedcambron
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-2024, RegexAdvice.com | ASP.NET Tutorials