From: "Jos Backus" <josb / cncdsl.com> > [...] > ext = mbox.scan(/-(.+)/)[0] > > sort of works but returns an Array; > > ext = mbox.scan(/-(.+)/)[0][0] > ext = mbox.scan(/-(.+)/).pop.pop > > works only when the scan matches, but throws a NameError on nil otherwise. ext = mbox.scan(/-(.+)/).flatten[0] ? :-) Regards, Bill