Created
February 27, 2014 15:55
-
-
Save cbhl/9252836 to your computer and use it in GitHub Desktop.
dt.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
p = re.compile("([0-9]{1,2}/[0-9]{1,2}/[0-9]{2,4} [0-9]{1,2}:[0-9]{2}:[0-9]{2}( (AM|PM|am|pm))?)") | |
for x in p.findall(sys.stdin.read()): | |
print x[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This Python script prints all date-like strings of the form #/#/#### #:##:## and ##/##/#### ##:##:## as well as some other permutations that probably aren't dates.
It will almost certainly print things that look like dates but aren't actually, but it should be a reasonable starting point.
Run it like follows from the command line:
You will need to install Python, of course.