View Single Post
Old 09-21-2017, 02:23 AM   #379
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by schnesim View Post
Have fun

(I had to add some spaces to prevent some parts being converted to smileys.)
If you wrap it in CODE tags, then it doesn't do the smiley substitutions.
Code:
date_time_re = r'([0-2]?[0-9]):([0-5][0-9])(?::([0-5][0-9])(?:\.([0-9]+))?)?\s*([AP]\.?M)?\s*(?:[A-Z]{3}?([+-][0-2]?[0-9](?::[0-5][0-9])?))?'
So, from the My Clippings files - German then Italian:
Code:
- Markierung Pos. 4921-27  | Hinzugefügt am Montag, 5. Mai 2014 6.49 Uhr GMT+01:01
-  La tua evidenziazione alla posizione 750-750 | Aggiunto in data venerdě 4 settembre 2015 07:44:20
The regex matches the time OK for the Italian version, but it matches the timezone for the German version.

The month selection then fails for the Italian version as it the selection is looking for either a comma or semi-colon to separate the date from preamble on the line. The German version should work if the time was extracted properly.
davidfor is offline   Reply With Quote