From: Robert Klemme Date: 2006-11-25T04:53:14+09:00 Subject: Re: A directory "grep" in RUBY? On 24.11.2006 15:38, Peter Bailey wrote: > Hi, > Can someone point me to a quick "grep" like function in RUBY? I use glob > all the time, but, I need the power of regular expressions when finding > particular files in directories. I see "grep" in the Pickaxe manual, > but, only as it relates to ".enum," which, sorry to say, I don't > understand. > > I need something like this, even though, I know this doesn't work: > Dir.glob(/^f[0-9]{7}\.eps/) Dir.glob('f*.eps').grep(/^f[0-9]{7}\.eps$/) There's plenty more options around. robert