or just :

my $String = "c:\my_files\file.jpg";
my (undef, $Ext) = (split /\./, $String);


-----Original Message-----
From: mario kulka [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 8:30 PM
To: [EMAIL PROTECTED]
Subject: matching patterns



I am trying to extract ".jpg" (subtype of the file) from the string:
c:\my_files\file.jpg

I found the following pattern on the net:
$file =~ s/.*[\/\\](.*)/$1/;
which extracts the file name (file.jpg). I understood most of that pattern 
except what does the (.*) part does? And how can I tweak it so I only get 
the "jpg" part.

thanks,
M



_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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