use strict; use warnings; #use utf8; my $str = "725-275 is an entry - and will be at 423-569 -but- not at 0 +12-457."; print "before: $str\n"; $str =~ s/([0-9]{3})-([0-9]{3})/$1\x{2014}$2/g; print "after: $str\n" produces: before: 725-275 is an entry - and will be at 423-569 -but- not at 012- +457. after: 725—275 is an entry - and will be at 423—569 -but- not at 012—4 +57.
In reply to Re^3: match substitution
by umasuresh
in thread match substitution
by ShayShay
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |