Help for this page

Select Code to Download


  1. or download this
    my $list = "This is my list";
    $list =~ m/^(.+?)   # The 'rest' (Everything before last word)
                (\w+)   # Last 'word' (string of contiguous word character
    +s)
                \W*$    # Possible non-word characters at end of string
              /x;
    
  2. or download this
    $word_re = qr{ (?: & | -? [a-zA-Z]+ [a-zA-Z-]* ) }x;