in reply to Re^2: Choosing regex delimiters
in thread Choosing regex delimiters
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Choosing regex delimiters
by xyzzy (Pilgrim) on Feb 06, 2009 at 18:40 UTC |