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 <bulliver / badcomputer.org> 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?
>