请问验证 YYYY-MM-DD 的正则表达式怎么写?谢谢!在CSDN上看到一个能验证三种格式的,可是我不会从里面挖出来这一部分,请教.if(Regex.IsMatch(start.Text,@"^(?:(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00)))(\/|-|\.)(?:0?2\1(?:29))$)|(?:(?:1[6-9]|[2-9]\d)?\d{2})(\/|-|\.)(?:(?:(?:0?[13578]|1[02])\2(?:31))|(?:(?:0?[1,3-9]|1[0-2])\2(29|30))|(?:(?:0?[1-9])|(?:1[0-2]))\2(?:0?[1-9]|1\d|2[0-8]))$"))
{
errorProvider1.SetError(start,"日期格式必须为0000/00/00和0000-00-00和0000.00.00这三种格式");
start.SelectAll();
start.Focus();
}
{
errorProvider1.SetError(start,"日期格式必须为0000/00/00和0000-00-00和0000.00.00这三种格式");
start.SelectAll();
start.Focus();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货