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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?<Day>[0-3][0-9]|[1-9])/(?<Month>[1-9]|1[0-2]|0[1-9])/(?<Year>[12]\d{3}|\d{2})
Description
evaluates dates in the format of DD/MM/YY or DD/MM/YYYY DD &amp; YY - can be of the form: One digit 2 Zero leading 02
Matches
1/3/98 | 01/03/04
Non-Matches
15/20/04 | 1/13/04 | 12/02/
Author Rating: The rating for this expression. yoram o
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: Only DD/MM
Name: Anderson(Brasil - Sao Paulo)
Date: 10/14/2006 11:49:22 AM
Comment:
Your expression accept day 39 for example. Your expression correct is : ([0-2][0-9]|3[0-1]|[1-9])/([1-9]|1[0-2]|0[1-9])/([12]\d{3}|\d{2}) I need only DD/MM and I used this : ([0-2][0-9]|3[0-1])/(1[0-2]|0[1-9]) And this is correct to.


Title: bug fix
Name: yoram o
Date: 9/25/2004 9:37:38 AM
Comment:
thanks to 'Davo' that found out that '12/02/' passes the test now it does not. thanks


Title: Bug
Name: Davo
Date: 9/23/2004 11:28:43 AM
Comment:
Very concise which is good however try: 12/02/ it matches even though no year...


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