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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jan 8, 2008, at 1:07 PM, Bartee Lamar 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Xavier Noria wrote:> On Jan 8, 2008, at 1:07 PM, Bartee Lamar 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. > > -- fxnWelllllllllll.... 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... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---