The definition of regexp-replace specifies the meanings of ‘pre and ‘post as substitution arguments.What I expect is that ‘pre/‘post will transform into(substring string start (regexp-match-submatch-start match 0))(substring string (regexp-match-submatch-end match 0) end)However, looking at the chibi implementation (the only one I’ve found after 10 minutes of searching), what these transform into is
(substring string 0 (regexp-match-submatch-start match 0))(substring string (regexp-match-submatch-end match 0) (string-length string))I suspect that this is a bug, given this sentence in the description:The optional parameters start and end restrict both the matching and the substitution, to the given indices, such that the result is equivalent to omitting these parameters and replacing on(substring str start end)
.
But I’d appreciate confirmation of this. It might also be good to clarify what happens here.