http://www.perlmonks.org?node_id=729480


in reply to Regex To Remove File Extension

You could try s/(.*)\..*/$1/, which will greedily match up to the last '.' and then keep that part. For common regexes, you should probably also check out Regexp::Common.