Why does this segment not work properly? $match = "cat(\d+)"; $replace = "\1dog"; $_ = "cat15"; s/$match/$replace/g; print $_; # prints --> \1dog Any ideas? TIA. - B