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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(?<From>(JANUARY|FEBRUARY|MARCH|APRIL|MAY|JUNE|JULY|AUGUST|SEPTEMBER|OCTOBER|NOVEMBER|DECEMBER|[ ]|,|/|[0-9])+)(-|–|:|TO)?(?<To>(JANUARY|FEBRUARY|MARCH|APRIL|MAY|JUNE|JULY|AUGUST|SEPTEMBER|OCTOBER|NOVEMBER|DECEMBER|[ ]|,|/|[0-9]|PRESENT)+)+(:)*
Description
This regular expression will match date given in any format expcept (mmm). Its speciality is that it divides dates into &lt;from&gt; part and &lt;to&gt; part. Use Groups to access these parts. e.g. JANUARY 1998 TO JUNE 2000 &lt;From&gt;=&quot;JANUARY 1998&quot; &lt;to&gt;=&quot;JUNE 2000&quot;
Matches
JANUARY 2000 | 19-01-2000 | 12/11/2000
Non-Matches
"Hello it is ordinary text" | "non -date text"
Author Rating: Not yet rated. Manpreet Grewal
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: hrnm..
Name: could be better
Date: 12/18/2008 8:25:39 AM
Comment:
"1/dsf dsfsd" also works... seems as long is it starts with "1/" it'll match.


Title: 1/a/a
Name: r
Date: 1/19/2004 4:04:29 PM
Comment:
1/a/a works?


Title: rate
Name: suchitra
Date: 12/2/2003 7:57:50 AM
Comment:
it works..good!


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