From: Bill Atkins Date: 2005-01-10T12:38:19+09:00 Subject: Re: brute force string search On Mon, 10 Jan 2005 12:32:03 +0900, Bertram Scharpf wrote: > What about this: > > str = File.new( 'longfile').read > str.scan /.*/ do |x| puts x if x =~ /xyz/ end How is that any different from Idea 1? To the OP, 0.5 seconds seems pretty fast to me. I doubt a C extension would make much difference since index is already written in C and probably already highly optimized. Bill -- $stdout.sync = true "Just another Ruby hacker.".each_byte do |b| ('a'..'z').step do|c|print c+"\b";sleep 0.007 end;print b.chr end; print "\n"