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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Date Match
Expression
^(d{0}|(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)))))|(29(?=FEB(((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}|\d{2}|d{0})$
Description
This pattern mathces the following date formats: DDMMMYY,DDMMMYYYY,DDMMMYY. The Pattern matches on leap year dates as well
Matches
12MAR02 | 12MAR2008 | 29FEB2008 | 12MAR
Non-Matches
29FEB2007 | 32MAR | 00APR
Author Rating: Not yet rated. Ole
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: Change 29 to 28 feb
Name: Bugs
Date: 8/21/2019 7:31:58 AM
Comment:
Change the regex to ^(d{0}|(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)))))|(28(?=FEB(((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}|\d{2}|d{0})$


Title: can u help me to write a expression to validate MMDDYY MMDDYYYY,MM/DD/YY,MM/DD/YYYY,MM-DD-YY,MM-DD-YYYY
Name: Rudra P
Date: 3/3/2009 4:36:51 AM
Comment:
can u help me to write a expression to validate MMDDYY MMDDYYYY,MM/DD/YY,MM/DD/YYYY,MM-DD-YY,MM-DD-YYYY


Title: invalid validation
Name: Brian Kejser
Date: 5/29/2008 8:32:06 PM
Comment:
matches not leap year dates, eg 29FEB2007


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