i needed a function for validate the entered date. whether entered date is in correct format. i browsed the web and got a regular expression for it. Its works fine except when you enter 12/12/YYYY(on any year) it shows error saying that its not a valid date.
bool IsDate(string date)
{
Match dobMatch = Regex.Match(date, @"^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$");
if (!dobMatch.Success)
{return true;}
else
{return false;}
}
i