Valid dates on regular expression

In Gregorian calendar, if a year is divisible by 400 then it is a leap year. 2000 is a leap year where 2100 is not. how would you implement (if year % 400 == 0) using only regular expression constructs? implementation using if else statement would be considered invalid since this will be dealt with externally. the solution will validate if February has 28 or 29 days. My problem deals with 4 digit year (from 1000) but any guide to a general solution will also be very helpful.

EDIT: Nevermind. Found Guide.


Try This Regex

It will match a leap year.


It will match

mm/dd/yyyy,m/dd/yyyy,mm,d/yyyy and m/d/yyyy

Check Here

Need Your Help

How to tell if a caught IOException is caused by the file being used by another process, without resorting to parsing the exception's Message property

.net file ioexception robustness

When I open a file, I want to know if it is being used by another process so I can perform special handling; any other IOException I will bubble up. An IOException's Message property contains "The

Implementing message flood protection via JS

javascript protection

I'm currently running a server. A bot that I coded currently supplies administrative tools for moderators, but I would like the bot to also have some sort of automated flood-protection system built...