regexp-replace part could use some improvement Duy Nguyen (05 Aug 2019 12:35 UTC)
Re: regexp-replace part could use some improvement Alex Shinn (09 Apr 2020 13:56 UTC)
Re: regexp-replace part could use some improvement Duy Nguyen (09 Apr 2020 14:07 UTC)
Re: regexp-replace part could use some improvement John Cowan (09 Apr 2020 15:56 UTC)
(missing)
Re: regexp-replace part could use some improvement John Cowan (10 Apr 2020 19:13 UTC)
Re: regexp-replace part could use some improvement Marc Nieper-Wißkirchen (10 Apr 2020 19:28 UTC)
Re: regexp-replace part could use some improvement Alex Shinn (13 Apr 2020 14:56 UTC)
Re: regexp-replace part could use some improvement Arthur A. Gleckler (13 Apr 2020 22:59 UTC)
Re: regexp-replace part could use some improvement Alex Shinn (13 Apr 2020 23:54 UTC)
Re: regexp-replace part could use some improvement Arthur A. Gleckler (09 Apr 2020 20:23 UTC)
Re: regexp-replace part could use some improvement Alex Shinn (10 Apr 2020 01:18 UTC)
Re: regexp-replace part could use some improvement Vincent Manis (10 Apr 2020 04:22 UTC)
Re: regexp-replace part could use some improvement Marc Nieper-Wißkirchen (10 Apr 2020 07:11 UTC)

regexp-replace part could use some improvement Duy Nguyen 05 Aug 2019 12:34 UTC

'subst' argument is described like this:

> subst can be a string, an integer or symbol indicating the contents of a numbered or named submatch of re, 'pre for the substring to the left of the match, or 'post for the substring to the right of the match.

what's missing is, 'subst' can also be a list of these symbols,
numbers or strings. I thought regexp-replace was very limited (if it
only supported either int, sym or str), but this makes it much better.
Chibi test suite does test this case.

Corner case: does 'subst' accept nested lists?

The user also cannot name capture groups 'pre' and 'post' if they want
to use them to replace. But I guess that ship has sailed.
--
Duy