function to find extension in file name string

I am very new to regular expressions. ( and RoR ).

I need to find the extension in a filename on a string.

I tried several RE's but cannot get one to work that will find the 1st dot from the end of a file name.

Also, to use this as a function for all of the applications I think it should go in the LIB subdirectory. Is that correct?

TIA

Please check File.extname.

-- fxn

Xavier Noria wrote: