Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    $modifiers = "g";
    $string =~ s/a/b/$modifiers;
    print $string;
    
  2. or download this
    #!/usr/bin/perl
    
    ...
    $replace = "$1";
    $string =~ s/a+(b+)a+/$replace/g;
    print $string;