Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my $the_rest = $1;
    print "the_rest='$the_rest'\n";
    print "last='$last'\n";
    
  2. or download this
    the_rest='This is my lis'
    last='t'
    
  3. or download this
    $list =~ /
        ^(.+)    # The 'rest' (Everything before last word)
        \b(\w+)  # Last 'word' (string of contiguous word characters)
        \W*$     # Possible non-word characters at end of string
    /x;