Hi all, I wanna validate date which can be either in short date format or long date format. eg: for some of the valid date.
12/05/2010 , 12/05/10 , 12-05-10, 12-05-2010
var reLong = /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/;
var reShort = /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{2}\b/;
var valid = (reLong.test(entry)) || (reShort.test(entry));
if(valid)
{
return true;
}
else
{
return false;
}
but this current regular expression fails when i try to give an invalid date as 12/05/20-0