Date Regular Expression (dd/MMM/yyyy)

The following matches:

  • 01/JAN/2007
  • 22/Feb/2006

But doesn't match:

  • 01/01/2007
  • 22/02/2007
  • 01 Jan 2007
^(([0-9])|([0-2][0-9])|([3][0-1]))\/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\/\d{4}$
Author Paul Hayman

Paul is the COO of kwiboo ltd and has more than 20 years IT consultancy experience. He has consulted for a number of blue chip companies and has been exposed to the folowing sectors: Utilities, Telecommunications, Insurance, Media, Investment Banking, Leisure, Legal, CRM, Pharmaceuticals, Interactive Gaming, Mobile Communications, Online Services.

Paul is the COO and co-founder of kwiboo (http://www.kwiboo.com/) and is also the creator of GeekZilla.

Comments

Madhu Sudan Mahanta said:

Thanks it's working.

18/Dec/2008 10:33 AM

Ronald said:

not working..

var reg = new RegExp("^(([0-9])|([0-2][0-9])|([3][0-1]))\/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\/\d{4}$");

reg.test("01/JAN/2007") will return false!

19/Aug/2009 05:59 AM

Harshada said:

Thanks alot !!!!

06/Aug/2010 09:29 AM

sid said:

not working

14/Feb/2011 18:29 PM

selvan said:

thanks

23/Apr/2012 07:58 AM

bhargav said:

its working..thank you

03/May/2012 11:17 AM

Add Comment

Name
Comment
 

Your comment has been received and will be shown once it passes moderation.