Return the extension from a file name
1 2 /(.*\.)(.*$)/.match(File.basename(file_name))[2]
DZone Snippets > duncanbeevers > regex
12732 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Duncan Beevers http://duncan.beevers.net
1 2 /(.*\.)(.*$)/.match(File.basename(file_name))[2]