but I want to know why parens in the variable screwed up one substitute but not the other one
The first argument of the substitution operator is {expected to be|treated as} a regex pattern.
The regex pattern «f(il)e» (line 7) matches the string «file» and captures «il» in $1 or some such variable.
The regex pattern «f\(il\)e» (line 11) matches the string «f(il)e».
In reply to Re: Parens mess up regex substitute
by ikegami
in thread Parens mess up regex substitute
by BenHopkins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |