java正则表达式语法大全 求8位出生年月日(中间不带符号)验证。要求月份是01到12,日是01到31的正则表达式?

求8位出生年月日(中间不带符号)验证。要求月份是01到12,日是01到31的正则表达式?python正则表达式辨别输入日期规范? 1. Python正则表达式的输入日期规范如下:year,month,

求8位出生年月日(中间不带符号)验证。要求月份是01到12,日是01到31的正则表达式?

python正则表达式辨别输入日期规范?

1. Python正则表达式的输入日期规范如下:

year,month,day=Eval(input(“please input year,day,separated by comma”)

]months=[31,28,31,30,31,30,30,31

]if(year%4==0 and year  0!=0)或(年@0==0):

months[1]=29#在闰年,二月最多有29天

如果month<1或month>12:

print(“legal month”

elif day<1或day>months[month 1

]print(“legal day”

else:

print(“legal month”

2)。代码:

3。结果:在闰年,二月的最大天数是29天