in reply to Re^2: Regular Expression Help
in thread Regular Expression Help
Or you could always split on your token separator and grab the last element in the resulting array.#!/usr/local/bin/perl use strict; my $string = '/one/two and three/and four / and five'; if ($string =~ /.*\/(.*?)$/) { print "Last token: $1\n"; }
|
|---|