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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^((31(?! (FEB|APR|JUN|SEP|NOV)))|((30|29)(?! FEB))|(29(?= FEB (((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\d|2[0-8])-(JAN|FEB|MAR|MAY|APR|JUL|JUN|AUG|OCT|SEP|NOV|DEC)-((1[6-9]|[2-9]\d)\d{2})$
Description
Mathces in format DD-MON-YYYY (hyphen between results). Validates for leap years. Ensures month is in uppercase.
Matches
9-MAY-1981 | 29-FEB-2004 | 25-DEC-1999
Non-Matches
09 MAY 1981 | 06 Jul 2003
Author Rating: The rating for this expression. Rohan Pathare
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

Title: Too bad it doesn't work
Name: Ben Oshman
Date: 12/5/2008 4:00:27 PM
Comment:
If only it would check for leap years, it would be perfect.


Title: Too bad it doesn't work
Name: Ben Oshman
Date: 12/5/2008 3:54:17 PM
Comment:
If only it would check for leap years, it would be perfect.


Title: This expression does not work
Name: George
Date: 7/31/2008 11:34:47 AM
Comment:
Did you test this? All dates are valid 31-FEB-2009 and more


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