>>> "ESF" == Eric S Fraga <e.fr...@ucl.ac.uk> writes:

> On Friday, 31 Dec 2021 at 14:21, Uwe Brauer wrote:
>> ⚠️ Caution: External sender
>> 
>> 
>> Hi
>> 
>> Does anybody know about a function that would convert between
>> date format  like 31.12.2021 to  <2020-12-31> and back?

> This is Emacs, of course, so you could use query-replace-regexp (M-%)
> with, for instance

> \([0-9][0-9]\)\.\([0-9][0-9]\)\.\([0-9]\{4\}\)

> as the pattern to search for and

> <\3-\2-\1>

> as the replacement.  The converse is left as an exercise for the
> reader. ;-)

Thanks the \{4\} surprise me. I tried

(query-replace-regexp "\\(\\<[0-9]*\\)\\([\\.]\\)\\([0-9]*\\>\\)" "\\3\\2\\1")

And that did not work.

Uwe 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to