"bruce" <[EMAIL PROTECTED]> wrote:
hi...

need to know if there's a quick regex to remove everything after a given
character.

ie
$foo = http://ww.rr.bb/cat/dog/index.html
or
$foo = http://ww.rr.bb/cat/dog/ball/abc.html

i'd like to know how to remove everything after the last "/"...

Not a regex, but try:

#!/usr/bin/perl
#
use File::Basename;
#
use strict;
use warnings;
#
my $foo = "http://ww.rr.bb/cat/dog/index.html";;
my (undef, $directory, undef) = fileparse($foo);
print $directory;
#
exit(0);

Regards,
Martin



_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to