[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Improve `replace-regexp-in-string' ergonomics?
From: |
Lars Ingebrigtsen |
Subject: |
Re: Improve `replace-regexp-in-string' ergonomics? |
Date: |
Wed, 22 Sep 2021 22:29:20 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Lars Ingebrigtsen <larsi@gnus.org> writes:
>> (foo-replace results
>> ("\\[" "(")
>> ("\\]" ")")
>> ("[[:lower:]]+" (upcase (match-string 0)))
>> ("siglo \\([0-9]+\\)"
>> (integer-to-roman (string-to-number (match-string 1))))
>> ...)
>
> Perfect. That looks like a really nice function signature to me.
> Perhaps without the parentheses if there's only one replacement to be
> done.
(And there could be an optional third element in the replacement lists
to do the SUBEXP action.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: Improve `replace-regexp-in-string' ergonomics?, (continued)
Re: Improve `replace-regexp-in-string' ergonomics?, Lars Ingebrigtsen, 2021/09/22
Re: Improve `replace-regexp-in-string' ergonomics?, Dmitry Gutov, 2021/09/22
Re: Improve `replace-regexp-in-string' ergonomics?, Stefan Monnier, 2021/09/22