in reply to Choosing regex delimiters
$_ = "adfjdk.kkk,8888888"; s/(.*?)\.(\w\w\w),/iif([month]>,$1.$2,0) as $2/; print "$_\n"; $_ = "adfjdk.kkk,8888888"; s|(.*?)\.(\w\w\w),|iif([month]>,$1.$2,0) as $2|; print "$_\n"; # prints: # iif([month]>,adfjdk.kkk,0) as kkk8888888 # iif([month]>,adfjdk.kkk,0) as kkk8888888
Update: Isn't the orginal question essentially, Why does s/// differ from s|||, all other things being equal? (And I doubt the claim.) But the other responses looked at quotes, which were identical in both expressions. Am I missing the point? OP, can you provide working examples that illustrate the problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Choosing regex delimiters
by xyzzy (Pilgrim) on Feb 06, 2009 at 18:05 UTC | |
by hbm (Hermit) on Feb 06, 2009 at 18:26 UTC | |
by xyzzy (Pilgrim) on Feb 06, 2009 at 18:40 UTC | |
by ikegami (Patriarch) on Feb 09, 2009 at 19:38 UTC |