9.15

来源:互联网 发布:顶尖微信数据恢复软件 编辑:程序博客网 时间:2024/05/16 18:29

今天做作业由于没有本所以不理想,但通过和同学的交互还是有了一些结果。

比如:if (year/4==0)
        {
            if (!Regex.IsMatch(str, "^[1-2][0-9][0-9][0-9][-](([0][2]))[-](([2][9])|([3][0-1]))$"))
            {
                bzh = "(^[1-2][0-9][0-9][0-9][-](([0][1,3,5,7,8])|([1][0,2]))[-](([0][0-9])|([1-2][0-9])|([3][0-1]))$)|(^[1-2][0-9][0-9][0-9][-](([0][4,6,9])|([1][1]))[-](([0][0-9])|([1-2][0-9])|([3][0]))$)";
            }
            else
                Response.Write("生日输入错误");
            if (Regex.IsMatch(str,bzh))
            {
                Response.Write("生日输入正确");
            }
            else
                Response.Write("生日输入错误");
        }
        if (year / 4 != 0)
        {
            if (!Regex.IsMatch(str, "^[1-2][0-9][0-9][0-9][-](([0][2]))[-]([3][0-1])$"))
            {
                bzh = "(^[1-2][0-9][0-9][0-9][-](([0][1,3,5,7,8])|([1][0,2]))[-](([0][0-9])|([1-2][0-9])|([3][0-1]))$)|(^[1-2][0-9][0-9][0-9][-](([0][4,6,9])|([1][1]))[-](([0][0-9])|([1-2][0-9])|([3][0]))$)";
            }