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\/(0?[13578]|1[02]))|((29|30)\/(0?[1,3-9]|1[0-2])))\/(1[6-9]|[2-9]\d)?\d{2})|(29\/0?2\/(((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])\/((0?[1-9])|(1[0-2]))\/((1[6-9]|[2-9]\d)?\d{2})) (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d$
Description
this expression validates a date-time field in European d/m/y h:m:s format. It is a european variation of Michael Ash's date-validation expression in this library. The days are validated for the given month and year. Leap years are validated for all 4 digits years from 1600-9999, and all 2 digits years except 00
Matches
29/02/2004 20:15:27 | 29/2/04 8:9:5 | 31/3/2004 9:20:17
Non-Matches
29/02/2003 20:15:15 | 2/29/04 20:15:15 | 31/3/4 9:20:17
Author Rating: The rating for this expression. martin devos
Source variation to Michael Ash's date-validation expression
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: Great info.
Name: Oisin C. Vera
Date: 9/30/2008 9:08:28 AM
Comment:
Awesome mate!! also thanks to the user comments with their updates.


Title: Great info.
Name: Oisin C. Vera
Date: 9/30/2008 9:06:45 AM
Comment:
Awesome mate!! also thanks to the user comments with their updates.


Title: mm/dd/yyyy hh:mm:ss format validation please
Name: Srini
Date: 2/4/2008 3:33:48 AM
Comment:
hi, iam new to regex. can you please change the regex to give support for mm/dd/yyyy hh:mm:ss ?


Title: mm/dd/yyyy hh:mm:ss format validation please
Name: Srini
Date: 2/4/2008 3:33:21 AM
Comment:
hi, iam new to regex. can you please change the regex to give support for mm/dd/yyyy hh:mm:ss ?


Title: Nice euro version
Name: Simon
Date: 11/8/2006 5:57:20 AM
Comment:
I was trying to mod the original but was getting nowhere fast! This is great. I didn't need the time bit but that was easy enough to remove. (20|21|22|23|[0-1]?\d):[0-5]?\d:[0-5]?\d


Title: awesome!!!
Name: Riccardo
Date: 10/20/2006 9:06:27 AM
Comment:
Simply perfect!!


Title: excelente
Name: nicolas graupen
Date: 9/28/2006 2:35:39 PM
Comment:
Excelent and simple expression congrts!


Title: thanks
Name: gerwin
Date: 6/15/2005 9:51:28 AM
Comment:
thank


Title: bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo
Name: bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo
Date: 3/29/2005 9:55:53 AM
Comment:
bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo bravo brav


Title: how bout mm/dd/yyyy
Name: amyan
Date: 10/27/2004 2:57:30 AM
Comment:
i need something like the above mentioned format think you could help? thnx


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