This one has as few flaws, first of all it is mm/dd instead of dd/mm which is easy enough to correct, but it doesn't prevent dates like 30/02 etc which are invalid. Is it possible to write a regex that does this? Maybe you would have to limit the years to 2004, 2005, 2006, 2007, 2008, so that you can only accept these years and so that you can check for the leap year for these years.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.