From: Harry Date: 2006-06-07T23:30:17+09:00 Subject: Re: regex for splitting filenames If you want to use regex, try this; str = "abc.def.ghi.jkl.mno" root, ext = /^.*\./.match(str).to_s.chop, /^.*\./.match(str).post_match Harry On 6/7/06, darren kirby wrote: > > fileroot, type = filename.split(/regex here?/) > > I cannot find a way to write a regex that only matches the last period in the > filename. Is there an elegant way to do this? >