> But how do I let it make : > $dir = "/IPlib/and/many/other/dirs"; ## But now on the first dir
$dir =~ s!^[^/]*!!; ^ = Beginning of the string. Rob -----Original Message----- From: David vd Geer Inhuur tbv IPlib [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 11:15 AM To: [EMAIL PROTECTED] Subject: Regex question again Hi, 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. Regs David -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]