@REREPLACE

May 20, 2008
10,563
78
Syracuse, NY, USA
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.]"
 
May 20, 2008
10,563
78
Syracuse, NY, USA
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
 
May 20, 2008
10,563
78
Syracuse, NY, USA
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.
 
Thread starter Similar threads Forum Replies Date
MickeyF Support 6
G Support 15