#!/usr/bin/perl use strict; use warnings; my list = "This is my list"; list =~ /(\w+)\s(\w+)/; my $last = $2; my $the_rest = $1 print $the_rest # "This is my" print $last # "list";
In reply to Match last word in a sentence by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |