my $file='/home/sites/site18/users/rjoseph/web/images/image1.jpg';
if ($file=~/^(.+)(\/web.+)$/) {
my $part1=$1;
my $part2=$2;
print "$part1\n$part2\n";
}
Produces the output of
/home/sites/site18/users/rjoseph /web/images/image1.jpgNow, the fun part begins when you have an image named "weblink.jpg" or something similiar. But I'll leave that as a exercise to the reader.
In reply to Re: Stripping parts of paths from directory names
by mr.nick
in thread Stripping parts of paths from directory names
by r.joseph
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |