From: James Edward Gray II Date: 2006-02-07T23:30:54+09:00 Subject: Re: Grep via Ruby On Feb 7, 2006, at 7:08 AM, ralf wrote: > I'd like to have a "grep" with case-insensitive match. You can turn options on/off inside a pattern. For example, here is a pattern that matches the word file, regardless of case: (?i:file) > Maybe this can be done a lot easier by using ARGF?? Yes it can. Your input loop can be replaced with: ARGF.grep(pattern) do |line| puts "#{ARGF.filename} #{ARGF.lineno}: #{line}" end Hope that helps. James Edward Gray II