On Thu, Dec 11, 2008 at 2:31 PM, Serdar Tumgoren <[email protected]> wrote: > Hey everyone, > > I was wondering if there is a way to use the datetime module to check for > variations on a month name when performing a regex match?
Parsing arbitrary dates is hard, in fact the most general case is not solvable since 7/8/07 could refer to July 8 or August 7 and the century must be guessed. The only approach I know of is to try the formats you expect until you find one that works. Mark Pilgrim's feedparser has a pretty robust date parser you might look at; look at the _parse_date() function in this module: http://code.google.com/p/feedparser/source/browse/trunk/feedparser/feedparser.py Kent _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
