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

On Jan 8, 2008, at 1:07 PM, Bartee L. wrote:

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

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

Please check File.extname.

– fxn

Xavier N. wrote:

On Jan 8, 2008, at 1:07 PM, Bartee L. wrote:

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

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

Please check File.extname.

– fxn

Welllllllllll…

LOL… Really…

I hate when the answer is soooo simple.

I guess I need to start reading ALL of the specs.

But Thanks for your quick response and EXCELLENT answer.

…bartee…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs