Back-refs in TPIPE's /replace's replacement string?

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
Does anyone know if it's possible to specify SED-style back-refs in TPIPE's /replace's replacement string. Below, SED's replacement string "\1" refers to the first parenthesized regular expression found in the target string.
Code:
v:\> echo 1234 | sed  -e "s/.\(..\)./\1/g"
23
 
#2
TPIPE does have some notion of (Perl) backrefs.
Code:
v:\> echo foo=foo | tpipe /replace=4,1,0,1,0,0,0,0,0,"(foo)=\1","bar"
bar
How do I specify a backref in a replacement string?
 
#3
Does anyone know if it's possible to specify SED-style back-refs in TPIPE's /replace's replacement string. Below, SED's replacement string "\1" refers to the first parenthesized regular expression found in the target string.
Code:
v:\> echo 1234 | sed  -e "s/.\(..\)./\1/g"
23
Answer: Like this:
Code:
v:\> echo 1234 | tpipe /replace=4,1,0,1,0,0,0,0,0,".(..).","$1"
23
It might be a good idea for TPIPE's help to include a link to http://www.datamystic.com/textpipe/htmlhelp/general usage/regular_expressions.htm (and perhaps other documentation).