前端之家收集整理的这篇文章主要介绍了
正则 日期,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
^((?:(?:1[6-9]|[2-9]\d)?\d{2})(?:((?:0?[13578]|1[02])(?:31))|(?:(?:0?[1,3-9]|1[0-2])(?:29|30)))|((?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))(?:(0)?2(29)))|^(?:(?:1[6-9]|[2-9]\d)?\d{2})(?:(?:0?[1-9])|(?:1[0-2]))(?:0?[1-9]|1\d|2[0-8]))(?:(0?\d|1\d|2[0-4])(?:0?\d|[1-5]\d)(?:0?\d|[1-5]\d)(?:\d{3}))$
此正则可以判断201701051849222,考虑了闰年