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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 2
Title Test Details Date Format
Expression
^(([0-9])|([0-2][0-9])|([3][0-1]))\/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\/\d{4}$
Description
This regular expressions matches dates of the form dd/MMM/yyyy where dd can be 1 or 2 digits long, MMM is a month abbreviation, and yyyy is always 4 digits long.
Matches
1/Feb/2007 | 03/Jun/2007 | 31/Dec/2007
Non-Matches
1/2/2007 | 03/Jun/07 | 31-Dec-2007
Author Rating: Not yet rated. Ken
Title Test Details DD/MMM/YYYY
Expression
^(?:((31\/(Jan|Mar|May|Jul|Aug|Oct|Dec))|((([0-2]\d)|30)\/(Jan|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))|(([01]\d|2[0-8])\/Feb))|(29\/Feb(?=\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))\/((1[6-9]|[2-9]\d)\d{2})$
Description
Matches dates in the form of DD/MMM/YYYY. It also handles leap years. Days are 2 digits; months are case sensitive with first character upper-case and next 2 characters lower-case; year is 4 digits.
Matches
01/Mar/2007 | 16/Dec/2007 | 29/Feb/2008
Non-Matches
1/Mar/2007 | 16/Dec/07 | 29/Feb/2007
Author Rating: Not yet rated. Ken
   Displaying page 1 of 1 pages; Items 1 to 2

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