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

Mario, I didn't mean to mislead you. Here it _is_ proper to speak of "file
extension" (or "suffix"). In the context of a MIME Content-type header like
"text/plain", the "plain" is a subtype, not a file extension.

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

You really should use the File::Basename module, which can split off the
extension in a portable fashion.

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

Reply via email to