Page 1 of 1
Date of birth regular expression
Posted: Wed Apr 02, 2008 4:25 pm
by rashi
I have an regular expression which validates date for dd/mm/yyyy format. I want to validate that leap year should have 30 days for month of Feb.
Can this be achieved using regular expression? If yes then how..and if no what other way it could be done..
Many thanks in anticipation.
Re: Date of birth regular expression
Posted: Wed Apr 02, 2008 5:47 pm
by EverLearning
I was under the impression that leap year should have
29 days in february, instead of 28.

Re: Date of birth regular expression
Posted: Fri Apr 04, 2008 7:14 am
by prometheuzz
rashi wrote:I have an regular expression which validates date for dd/mm/yyyy format. I want to validate that leap year should have 30 days for month of Feb.
Can this be achieved using regular expression? If yes then how..
If it is possible, it would be a truly horrific regex! So don't even try: regex is not the tool for this job!
rashi wrote:and if no what other way it could be done..
Many thanks in anticipation.
By programming it. Preferably in a language you're familiar with...
Re: Date of birth regular expression
Posted: Fri Apr 04, 2008 9:07 am
by onion2k
PHP has a checkdate() function for checking if a date is valid.