楼上的关于日期的正则
^((({2})(0||)) #闰年,能被4整除但不能被100整除
|((0||)00) #闰年,能被400整除
-02-29)#匹配闰年2月29日这一天。如果不是这一天,则由下面式子继续匹配验证。
|({3}|{2}{1}|{1}{2}|{3}) #平年(0001-9999)
-(((0|1)-(0||3)) #月日,1、3、5、7、8、10、12月有31天
|((0|11)-(0||30)) #月日,4、6、9、11月有30天
|(02-(0||2))) #平年2月只有28天,月日表示为【02-01至02-28】
要用到的时候翻来看看,很有用{:5_108:}
虽然现在晚上11点50了,但是我还是觉得看的很爽哈哈哈
确实当字典来用时比较好的选择,当不会了或者需要了就来查一下
bencao 发表于 2018-5-2 11:51
特狼噗你好
买一个来学学{:10_266:}
没钱没学习{:5_94:}
占楼,学习~
阿萨德
今天一下子花了 200 多鱼币。
收藏收藏
鱼币是啥
太贵了,买不起了
没鱼币看啊
没有币看不了
30鱼B.....是乐至
how can I use regular expression to define if my insert strings is in a format of date.
for example:
import re
pattern = r"(\d)(\d)(\d)"
But I need the first group in the range of 01 to 31, and the second one in the range of 01 to 12. the third one should be in four digitals.
学习
好细,好容易理解,这是真的好
看完表示死了1000W个脑细胞。。。。