Mmmm, good thought.
I tested it, and you're right:
However, the code I use to set up the substitution is:
which has been working.
If I change it to test your theory, to be:
then it does not find any CRLR to substitute.
So Xreplace has a different meaning for \r and \n depending on whether it is the source or the target of the substitution.
New 4UTILS on lucky.syr.edu. That was easy. See before/after below. I recall some collaboration with Rex on XREPLACE/REREPLACE. If they are still similar, than the necessary change is obvious. Here's what WAS in 4UTILS; it needed to be split into two cases.:
Having looked at the code for @XREPLACE, I think there are two features (????) that @REREPLACE doesn't have.
You can limit the number of replacements that are made to N by prefixing <pattern> with N$. And, if any of the parameters are the name of an environment variable prefixed with '@', @XREPLACE will de-reference the envvar. If I recall correctly, that was an attempt to get around strings with troublesome characters in them. Examples: