Hi Melanie

If it's regex you wanna use, here it is :

$fullpath = '/usr/local/home/mel/file.txt';
$fullpath =~ /(.*)\/(.*)\.(.*)/;
$path = $1;
$file = $2;
$ext  = $3;

-aman.

-----Original Message-----
From: Melanie Rouette [mailto:mrouette@;omnisig.com]
Sent: Friday, November 15, 2002 8:49 PM
To: beginners
Subject: reg ex question


Hi,
I have something like: /usr/local/home/mel/file.txt and I'd like to 
strip it so that I can put the path in a variable, the file name in 
another one and the extention in a another one as well. How do I do 
that, can I do it all in a same expression.  Something like, $path = 
/usr/local/home/mel, $filename = file and finally $ext = txt.

Thanks in advance.
Melanie


-- 
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]

Reply via email to