Commits

Miki Tebeka committed 8c28d17

Fixed bug in parse-text

Comments (0)

Files changed (1)

 (def *date-re* #"(\d+)-(\d+)-(\d+)")
 
 (defn logfile-day 
-  "\"2010-01-01\" -> #<DateTime 2010-01-01T00:00:00.000Z>"
+  "\"logs/2010-01-01.html\" -> #<DateTime 2010-01-01T00:00:00.000Z>"
   [logfile]
   (let [[match year month day] (re-find *date-re* logfile)]
     (apply date-time (map str->long [year month day]))))
   "\"21:38 chouser: great, thanks!\" -> 
       [\"21:38\" \"chouser:\" \"great, thanks!\"]"
   [text]
-  (rest (re-find #"^(\d+):(\d+)(.+:)?(.*)" text)))
+  (rest (re-find #"^(\d+):(\d+)([^:]+:)?(.*)" text)))
 
 (defn process-p
   "Process a <p>...</p> log recrod, return {:time ... :tokens ... :user ..}"