- The first Regular Expression Library on the Web!

Please support RegExLib Sponsors


Regular Expression Details

Title Test Find Months
This RE validate the full name of the months.
January | May | October
Jan | Septem | Octo
Author Rating: The rating for this expression. Michael Ash
Your Rating
Bad Good

Enter New 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: louboutin049
Name: louboutin049
Date: 10/5/2012 2:28:48 AM
This is all very new to me and this article really opened my eyes.Thanks for sharing with us your wisdom.

Title: RE: Probably Unnecessary
Name: Michael Ash
Date: 5/9/2009 11:46:14 PM
Aside from the captures, which could be made non capture groups,the above pattern would probably process as fast or faster than the alternataion suggested because the pattern can fail quicker for most months. Jan-May would process in the same time. But the other months would be matched after fewer test. June for instance would require 5 failed test before matching with simple alternation. The posted pattern would match the "J" failed once on the a in anuary then match June.

Title: Probably Unnecessary
Name: JB
Date: 4/14/2009 1:21:34 PM
If you just type them out it is only one extra character and probably saves on processing time: ^January|February|March|April|May|June|July|August|September|October|November|December$

Title: nice work
Name: finnigan
Date: 3/26/2006 6:02:47 PM
Juness is definately not a moonth...

Title: Expression: J(anuary|u(ne|ly))|February|Ma(rch|y)|A(pril|ugust)|(((Sept|
Name: Manjunath
Date: 7/8/2004 7:33:38 AM
Expression: J(anuary|u(ne|ly))|February|Ma(rch|y)|A(pril|ugust)|(((Sept| Nov|Dec)em)|Octo)ber this will not work if you entere Juness

Copyright © 2001-2024, | ASP.NET Tutorials