Skip to content

Instantly share code, notes, and snippets.

@paul-hammant
Created January 2, 2018 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paul-hammant/cda6da1ee075424f28a8a76755f28d32 to your computer and use it in GitHub Desktop.
Save paul-hammant/cda6da1ee075424f28a8a76755f28d32 to your computer and use it in GitHub Desktop.
three of a hundreds of date regexes
# RFC 822, updated by RFC 1123 - e.g. Sun, 06 Nov 1994 08:49:37 GMT
Date: ((Mon|Tue|Wed|Thu|Fri|Sat|Sun), [0-9]{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{4} [0-9]{2}:[0-9]{2}:[0-9]{2} GMT)
# RFC 850 (obsoleted by RFC 1036) - e.g. Sunday, 06-Nov-94 08:49:37 GMT
Date: ((Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day, [0-9]{2}-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} GMT)
# ANSI C's asctime() format - e.g. Sun Nov 6 08:49:37 1994
Date: ((Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) *[0-9]{1,2} [0-9]{1,2}:[0-9]{2}:[0-9]{2} [0-9]{4})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment