in reply to Re: Question on File position, pulling words
in thread Question on File position, pulling words
Almost correct, you need to anchor the regex at the end of the string.
my @last_two = $string =~ /(\S+)\s+(\S+)$/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Question on File position, pulling words
by Narveson (Chaplain) on Mar 04, 2008 at 07:11 UTC | |
by hipowls (Curate) on Mar 04, 2008 at 07:42 UTC |