Author: xixigongzhu (Xi Xi Princess) http://search.9cbs.net/Expert/topic/1974/1974227.xml?temp=.6640131 First, your range is 1800-3999 year leap year: 1800, 1900, 2100, 2200, 2300, 2500, 2600, 2700, 2900, 3000, 3100, 3300, 3400, 3500, 3700, 3800, 3900 are special values (can be 4 unreasonable but not annihilation), it is divided into: string leap1 = (((1 [8-9]) | ([2-3]))) (0 | 2 | 4 | 6 | 8) (4 | 8)) "; String Leap2 =" ((( (2 (0 | 4 | 8))) | (3 (2 | 6))) 00) "; other 0 end: string leap3 =" ((1 [8-9]) | ([2-3 ] [0-9])) (2 | 4 | 6 | 8) 0) "; 2, 6: String Leap4 =" ((1 [8-9]) | ([2-3] [0 -9])) (1 | 3 | 5 | 7 | 9) (2 | 6)) "; Retury February: String Leapmonth =" (02 - (([0-1] [1-9]) | (10) | (2 [0-8]))) "; other month: string Other1 =" ((01) | (0 [3-9]) | (1 [0-2])) - ((( [0-2] [1-9]) | ([1-3] 0)))) "; String Other2 =" (((0 (1 | 3 | 5 | 7 | 8)) | (10) | ( 12)) - (31)) "; use 4 regular expressions above | connection, then plus the processes of February and other months of Return: String Leap =" (" Leap1 " | Leap2 "| Leap3 " | " Leap4 ") - (" LeapMonth " | " Other1 " | " Other2 ") "
Non-Run-year: String Noleap1 = "((1 [8-9]) | ([2-3] [0-9]))) (0 | 2 | 4 | 6 | 8) (1 | 2 | 3 | 5 | 6 | 7 | 9)) "; String Noleap2 =" ((1 [8-9]) | (2 (1 | 2 | 3 | 5 | 6 | 7 | 9)) | (3 (0 | 1 | 3 | 4 | 5 | 7 | 8 | 9)) 00) "; String Noleap3 =" ((1 [8-9]) | ([2-3] [0-9])))) (1 | 3 | 5 | 7 | 9) (0 | 1 | 3 | 4 | 5 | 7 | 8 | 9)) "; Non-Return of February: String Month =" (02 - ((([0-2] [ 1-9]) | ([1-2] 0))) "; 3 of the three regular expressions | connection, then plus the treatment of non-retreat February and other months: String Noleap =" (" Noleap1 | " Noleap2 " | " Noleap3 ") - (" Month " | Other1 "| Other2 ") "; Combination of the regular expression of the annual and non-annual years It is: String YearRegex = Leap "|" NOLLAP;