Skip to content

Instantly share code, notes, and snippets.

@crunk1
crunk1 / rfc3339regex.txt
Last active November 3, 2020 02:25
RFC3339 regexes - with day checking including leap years!
# https://tools.ietf.org/html/rfc3339
# https://en.wikipedia.org/wiki/Leap_year
## LEAP YEARS ##
# From wikipedia: "Every year that is exactly divisible by four is a leap year,
# except for years that are exactly divisible by 100, but these centurial years
# are leap years if they are exactly divisible by 400. For example, the years 1700,
# 1800, and 1900 are not leap years, but the years 1600 and 2000 are."
#
# Therefore, the following years are leap years: