TPIPE: unbalanced escaped quotes in a regex?

May 20, 2008
12,175
133
Syracuse, NY, USA
Neither Onig or a number of Gnu text utilities are bothered by unbalanced escaped quotes in a regular expression. But TPIPE seems to be. Below, in the second example, I replaced the first \" with just . (dot). What's up with that?

Code:
v:\> echo "foo" | tpipe /replace=4,1,0,1,0,0,0,0,0,"\"(.*)\"","$1"
foo

v:\> echo "foo" | tpipe /replace=4,1,0,1,0,0,0,0,0,".(.*)\"","$1"
TPIPE: The parameter is incorrect.
"".(.*)\"","$1""
 

samintz

Scott Mintz
May 20, 2008
1,557
26
Solon, OH, USA
I noticed something similar with @regexsub. It fails to match the quote and then fails to match anything - i.e. it returns an empty string.
 
May 20, 2008
12,175
133
Syracuse, NY, USA
I noticed something similar with @regexsub. It fails to match the quote and then fails to match anything - i.e. it returns an empty string.
@REGEXSUB (Onig) seems OK to me.
Code:
v:\> echo %@regexsub[1,\"(.*)\","foo"]
foo

v:\> echo %@regexsub[1,.(.*)\","foo"]
foo

v:\> echo %@regexsub[1,\"(.*).,"foo"]
foo
 

rconn

Administrator
Staff member
May 14, 2008
12,557
167
Neither Onig or a number of Gnu text utilities are bothered by unbalanced escaped quotes in a regular expression. But TPIPE seems to be. Below, in the second example, I replaced the first \" with just . (dot). What's up with that?

WAD - TPIPE has to extract the individual arguments, and it can't do that with mismatched quotes.
 

Similar threads