62,046
社区成员
发帖
与我相关
我的任务
分享
ValidationExpression="(((0?[13578]|1[02])/(0?[1-9]|[12]\d|3[01])/((1[6-9]|[2-9]\d)\d{2}))|((0?[13456789]|1[012])/(0?[1-9]|[12]\d|30)/((1[6-9]|[2-9]\d)\d{2}))|(0?2/(0?[1-9]|1\d|2[0-8])/((1[6-9]|[2-9]\d)\d{2}))|(0?2/29/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$"
string yourStr = "01/29/99";
Regex MMddyy = new Regex(@"(0[1-9]|1[0-2])/(0?[1-9]|[12]\d|3[01])/([1-9]{2}|0[1-9]|[1-9]0)");
if(MMddyy.Match(yourStr).Success)
Console.WriteLine(MMddyy.Match(yourStr).Value);
Regex MMddyy = new Regex(@"(0?[13578]|1[02])/(0?[1-9]|[12]\d|3[01])/([1-9]{2}|0[1-9]|[1-9]0)");
Regex MMddyy = new Regex(@"(0?[13578]|1[02])/(0?[1-9]|[12]\d|3[01])/([1-9]{2}|0[1-9])");
static void Main(string[] args)
{
Regex MM = new Regex (@"0?[13578]|1[02]");
Regex dd = new Regex (@"0?[1-9]|[12]\d|3[01]");
Regex yy = new Regex (@"[1-9]{2}|0[1-9]");
}