in reply to Re: Choosing regex delimiters
in thread Choosing regex delimiters

[01-estimate].jan, [01-estimate].feb, [01-estimate].mar, [01-estimate].apr, (etc...)
This is on Windows XP using ActivePerl EE 5.8.6. Using s/// makes no substitutions, using s||| works as expected. Is this something specific to the XP command line?

Replies are listed 'Best First'.
Re^3: Choosing regex delimiters
by hbm (Hermit) on Feb 06, 2009 at 18:26 UTC

    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
      I think it's an XP issue because I don't even get a substitution with s///
Re^3: Choosing regex delimiters
by ikegami (Patriarch) on Feb 09, 2009 at 19:38 UTC

    It should and does work fine in XP's cmd shell.

    >perl -p -e "s|(.*?)\.(\w\w\w),|iif([month]>,$1.$2,0) as $2|" temp.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 iif([month]>,[01-estimate].apr,0) as apr >perl -p -e "s/(.*?)\.(\w\w\w),/iif([month]>,$1.$2,0) as $2/" temp.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 iif([month]>,[01-estimate].apr,0) as apr

    Tested with with ActivePerl 5.6.0, 5.6.1, 5.8.0, 5.8.8, 5.10.0