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 1
Title Test Details Pattern Title
Expression
(^(((([1-9])|([0][1-9])|([1-2][0-9])|(30))\-([A,a][P,p][R,r]|[J,j][U,u][N,n]|[S,s][E,e][P,p]|[N,n][O,o][V,v]))|((([1-9])|([0][1-9])|([1-2][0-9])|([3][0-1]))\-([J,j][A,a][N,n]|[M,m][A,a][R,r]|[M,m][A,a][Y,y]|[J,j][U,u][L,l]|[A,a][U,u][G,g]|[O,o][C,c][T,t]|[D,d][E,e][C,c])))\-[0-9]{4}$)|(^(([1-9])|([0][1-9])|([1][0-9])|([2][0-8]))\-([F,f][E,e][B,b])\-[0-9]{2}(([02468][1235679])|([13579][01345789]))$)|(^(([1-9])|([0][1-9])|([1][0-9])|([2][0-9]))\-([F,f][E,e][B,b])\-[0-9]{2}(([02468][048])|([13579][26]))$)
Description
I have written this regular expression for use in javascript. It sould work for other languages directly or with minor changes. The parsing logic in this regular expression works like this : Imagine a tree structure, input at the root, Level 1 : two branches one-non Feb months two-Feb month. In the Feb month again two branches one-leap year Feb and two-non leap year Feb. In the non-Feb branch, we have two branches again, one-30 days month and two-31 days month. Once you get this, I think it will be easier to figure out the rest.
Matches
29-Feb-2000 | 1-jan-2007 | 31-dEC-1770
Non-Matches
32-Jan-2001 | 30-Feb-2004 | 0-nov-2004
Author Rating: Not yet rated. Moiz Tankiwala
   Displaying page 1 of 1 pages; Items 1 to 1

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