in reply to Finding a extention

This is Perl, so there's more than one way of doing this. One is indeed a regexp:
$ext="i_am_the_walrus.txt"; $ext=~s/^[^.]*(\.[\w]+$)/$1/; print $ext;
A second way is to use substr and index:
use strict; my $filename="you_are_the_whale.doc"; my $separator="."; unless (($where=index($filename,$seperator) == -1) { my $ext=substr($filename,$where); print $ext; } else { print "No extensions in the zoo.\n"; }
The third, and probably nicest way, is to use File::Basename:
use strict; use File::Basename; my $filename="we_are_not_all_mammals.zoo"; my ($base, $directory, $ext)=fileparse($filename, '\.[\w]+$'); print $ext;
Beware that the above assumes you're dealing with simple .xyz extensions. For more complicated stuff, see the regexp in elusion's reply above.

CU
Robartes-

Update: Fixed regexp so it actually works :) (thx elusion). Adapted second recipe to include dot.