What do you get?
Try:

my $topdir = "common/default/l_cs";

# Find the part of the string that does not have a slash and is
followed by end of line
$topdir =~ /([^\/]+)$/; # Or should that read /([^/]+)$/ ?

my $lang = $1;


On 4/18/07, Nishi <[EMAIL PROTECTED]> wrote:
Hi:

I am using the following reqular expression to extract the last part ie
$lang of the following string
$topdir = "common/default/l_cs";
my $lang=$topdir =~ /.*\/(.+)$/;

But it doesnt seem to work, what am i missing here?

Thanks!


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to