Hey
I'm using a regular expression to check the format of a supplied date in my ASP.NET MVC exception. However, every time I run it the action the web server crashes and Visual Studio reports and unhandled System.StackOverflowException
//If the supplied date does not match the format yyyy-mm-dd
//Regex taken from www.regexlib.com
if(!Regex.Match(date, "^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))$").Success)
{
ModelState.AddModelError("Date", "Date is in an invalid format. It must in the format yyyy-mm-dd");
}
Has anybody come across this before?