[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pattern matching and date formatting
From: |
Kamil Jońca |
Subject: |
pattern matching and date formatting |
Date: |
Wed, 08 Dec 2010 15:12:30 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
(posted to gnu.emacs.gnus by mistake)
I tried to make my own search engine for imap (I cannot make nnir-imap
to search with multiple criteria like "from" & "sent-date" - am I
missing somethig?)
Code is at: http://strony.aster.pl/kjonca/nnir-local.el (shamelessly
copied and modified nnir-imap code)
My questions are:
1.
#v+
(string-match
"\\([[:digit:]]\\{1,2\\}/[[:digit:]]\\{1,2\\}/[[:digit:]]\\{4\\}\\)?-\\([[:digit:]]\\{1,2\\}/[[:digit:]]\\{1,2\\}/[[:digit:]]\\{4\\}\\)?"
datestring)
(message "Date range: %s " (match-string 1 datestring))
( setq dmin (match-string 1 datestring ))
( setq dmax (match-string 2 datestring ))
(message "Date range: dmin=%s dmax=%s end=%d" dmin dmax (match-end 0))
#v-
when I used "(match-string 1)" instead of "(match-string 1 datestring)",
it uses whole string not "datestring" variable as in
"string-match". Why?
2.
#v+
(format-time-string "%d-%b-%Y" (encode-time 0 0 0 (string-to-number dday)
(string-to-number dmon) (string-to-number dyear) ))
#v-
%b - locale's abbreviated month name - can I make to use C locale here?
KJ
--
http://blogdebart.pl/2010/03/17/dalsze-przygody-swinki-w-new-jersey/
Niebawem ludziom, zwierzętom, i książkom wyrosną antenki.
GW
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- pattern matching and date formatting,
Kamil Jońca <=