Help for this page

Select Code to Download


  1. or download this
    use strict;
    
    ...
            my @matches = m/(\d+)|([^\d]+)/g;
            print join ":", grep { defined $_ and $_ !~ m/^(r|rd|red)$/i }
    + @matches;
    }
    
  2. or download this
    $ echo "12345 (Gray) 6789 (Red)" |  ./red.pl
    12345:Gray:6789
    ...
    12345:Gray:6789
    $ echo "12345Gray6789Red" |  ./red.pl
    12345:Gray:6789