Welcome!

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

SignUp Now!

TPIPE: unbalanced escaped quotes in a regex?

May
12,834
163
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""
 
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.
 
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
 

Similar threads

Back
Top