I just thought of a way to avoid recursion or unintended replacement when doing a search & replace routine over a set of strings (or even one big string).
I thought I’d write it down here in case I ever want to come back to it. (Also as a potential point of conversation.)