Thanks John,

   I may have to go along with Drieux and "Let it be known" YOU are The GOD
of regEx!

-----Original Message-----
From: John W. Krahn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 6:48 PM
To: [EMAIL PROTECTED]
Subject: Re: string manipulation


Jaimee Spencer wrote:
> 
> From: John W. Krahn [mailto:[EMAIL PROTECTED]]
> > 
> > Either of these should work:
> > 
> > (my $projectId) = $projectDocDir =~ m!.*/(\w+)/!;
> > 
> > # or
> > 
> > my $projectId = (split /\//, $projectDocDir)[-2];
> 
>    I know I am missing something basic here also, but tell me in the
example
> (my $projectId) = $projectDocDir =~ m!.*/(\w+)/!;
> why isn't the /1_0001.doc being printed as well?

Because the (\w+) has to have a slash '/' in front of and behind it. 
/1_0001.doc doesn't have a slash at the end.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to