From: 7stud -- Date: 2007-10-02T22:41:50+09:00 Subject: Re: finding files with regular expressions Remco Hh wrote: > > I want to search in a directory for files, matching a certain regular > expression. The script should not return true or false, but should give > me a list (array) of filenames which are found. > Try something like this: results = [] Dir.foreach("./programs_ruby") do |filename| if filename.index("mod") results << filename end end p results -- Posted via http://www.ruby-forum.com/.