Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
    my $string = "foo 1foo foo2  3foo4  foo5bar 87";
    $string =~  s/\d*[a-z]\d*//g;
    print "$string\n";
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
    my $mandatory = qr/[a-zA-Z]/;
    $string =~  s/$optional*$mandatory$optional*//g;
    print "$string\n";