in reply to Matching Problem
something like this will do it if it is always a .gif that marks the break.
my $title = "This is the New Title cool_image.gif Tue Feb 8 09:43:17 2 +005"; if ($title=~/(.*)\s+(\w+\.gif)/) { print $1 }else { print "no match" }
or to be a bit more generic
$title=~/(.*)\s+(\w+\.\w+)/
there is a problem if you have two xxxx.xxx items in the title, the .* will be greedy so in that case we can use this
$title=~/(.*?)\s+(\w+\.\w+)/
Cheers,
R.
|
|---|