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.
Date of birth regular expression
Moderator: General Moderators
- EverLearning
- Forum Contributor
- Posts: 282
- Joined: Sat Feb 23, 2008 3:49 am
- Location: Niš, Serbia
Re: Date of birth regular expression
I was under the impression that leap year should have 29 days in february, instead of 28. 
- prometheuzz
- Forum Regular
- Posts: 779
- Joined: Fri Apr 04, 2008 5:51 am
Re: Date of birth regular expression
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: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..
By programming it. Preferably in a language you're familiar with...rashi wrote:and if no what other way it could be done..
Many thanks in anticipation.
Re: Date of birth regular expression
PHP has a checkdate() function for checking if a date is valid.