on Thu, 27 Jun 2002 15:15:04 GMT, [EMAIL PROTECTED]
(David Vd Geer Inhuur Tbv Iplib) wrote: 

> Can you please assist. I am stuck on a regex again.
> 
> my $dir = "/user/IPlib/and/many/other/dirs";
> 
>  $dir =~ s!/[^/]*\z!!;
> 
> Will make : $dir = "/user/IPlib/and/many/other"; ## so it takes
> off the last dir 
> 
> But how do I let it make :
> 
> $dir = "/IPlib/and/many/other/dirs";  ## But now on the first dir
> 
> 
> Can't find my way on regex.

Why do you insist on using regexen for this kind problem? Did you 
look into the 'File::Spec' module as I suggested some time ago, when 
you posted a similar problem?

(see <http://groups.google.com/groups?selm=Xns92328868C454Cfge123%
4064.70.54.95>)

-- 
felix

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

Reply via email to