Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

@REREPLACE

May
12,846
164
The @REREPLACE page is missing from the help (or at least from the index). Clicking @REREPLACE in "What's new" takes you to the @SERIALPORTCLOSE page.

I don't know whether @REREPLACE is supposed to act exactly like @XREPLACE, but I can't do this one with @REREPLACE:

Code:
v:\> echo %@xreplace["My dog has (.*)",\1,My dog has fleas.]
fleas.
 
v:\> echo %@rereplace["My dog has (.*)",\1,My dog has fleas.]
TCC: (Sys) The parameter is incorrect.
"%@rereplace["My dog has (.*)",\1,My dog has fleas.]"
 
OK, if I leave out the quotes, it works:
Code:
v:\> echo %@rereplace[My dog has (.*),\1,My dog has fleas.]
fleas.

And commas in either re must be escaped ... right ... that's OK.
Code:
v:\> echo %@xreplace["(?i)[a-z]*, (.*)",\1,Fatica, Vincent]
Vincent
 
v:\> echo %@rereplace[(?i)[a-z]*^, (.*),\1,Fatica, Vincent]
Vincent
 
It would be surprising if it did, since I've never seen or used @XREPLACE.



I added support for (unnecessary) surrounding quotes in 14.0.16.
I wasn't asking for that ... only figuring out how it worked. @XREPLACE uses quotes to protect commas in the RE and the replacement string. I like @REREPLACE's approach better ... let the user escape such quotes ... because in nearly all such instances, he can do so because he's composing those two parameters.
 
Back
Top