Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        $str =~ s/^R(?:([12])|(3))?$/${1}text$2/;
        $str;
    }
    
  2. or download this
    sub munge {
        my $str = shift;
    ...
                 {(defined $1 ? $1 : '') . 'text' . (defined $2 ? $2 : '')
    +}e;
        $str;
    }