No surprises, I get the wrong results with double-quotes and the correct results with single-quotes; and identical results in each case, whether delimiting with / or |.
$ perl -p -e "s/(.*?)\.(\w\w\w),/iif([month]>,$1.$2,0) as $2/" z.txt iif([month]>,.,0) as iif([month]>,.,0) as iif([month]>,.,0) as $ perl -p -e "s|(.*?)\.(\w\w\w),|iif([month]>,$1.$2,0) as $2|" z.txt iif([month]>,.,0) as iif([month]>,.,0) as iif([month]>,.,0) as $ perl -p -e 's|(.*?)\.(\w\w\w),|iif([month]>,$1.$2,0) as $2|' z.txt iif([month]>,[01-estimate].jan,0) as jan iif([month]>,[01-estimate].feb,0) as feb iif([month]>,[01-estimate].mar,0) as mar $ perl -p -e 's/(.*?)\.(\w\w\w),/iif([month]>,$1.$2,0) as $2/' z.txt iif([month]>,[01-estimate].jan,0) as jan iif([month]>,[01-estimate].feb,0) as feb iif([month]>,[01-estimate].mar,0) as mar
In reply to Re^3: Choosing regex delimiters
by hbm
in thread Choosing regex delimiters
by xyzzy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |