nikolay has asked for the wisdom of the Perl Monks concerning the following question:
Have a good time of the day.
How do i accomplish an exchange of «йц,» to «фы,» as follows:
use utf8::all; $sod='йц,'; $a=q~(?^u:йц(\W))~; #$b=qq~фы$1~; $b=q~фы$1~; print "$sod\n"; $sod=~s#$a#$b#g; print "$sod\n";
? I expect that regexp turns «йц,» to «фы,», but actually i get «йц,» turns to «фы» or to «фы$1» -- depending on whither i use $b w/ double or single quatation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexp interpolation.
by choroba (Cardinal) on Sep 16, 2015 at 13:44 UTC |