From: Michael Guterl Date: 2008-10-25T08:17:08+09:00 Subject: Re: help with regular expressions On Fri, Oct 24, 2008 at 7:12 PM, Craig Demyanovich wrote: > On Fri, Oct 24, 2008 at 6:05 PM, Siep Korteling wrote: > >> You don't need a regular expression for this. To select the lines which >> include a slash, you can do >> >> file = File.new( 'D:/1.txt' ) >> slashlines = file.select {|line| line.include?( '/' )} >> file.close >> puts slashlines >> >> >> The select method will read each line and put each line for which the >> block is true in an array. > > > Siep, I can't find any documentation on File#select, and IO#select is not > documented as doing what you show. Could you provide more info about it? > It is a method from Enumerable. ri Enumerable#select Michael Guterl