use strict; use warnings; #use utf8; my $str = "725-275 is an entry - and will be at 423-569 -but- not at 012-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—457.