From: Joseph McDonald Date: 2002-09-18T01:34:59+09:00 Subject: Re: Java vs. Perl vs. ... MS> File.open(ARGV[1], 'w') { |out| MS> File.open(ARGV[0]).each_line { |line| MS> unless ( line =~ /\.(?:css|jpg|gif|CSS|JPG|GIF) HTTP/ or MS> line =~ /^192\.(9|18|29)\./) MS> out.print(line) MS> end MS> } MS> } This one might be a little faster: r1 = Regexp.new(/\.(?:css|jpg|gif|CSS|JPG|GIF) HTTP/) r2 = Regexp.new(/^192\.(9|18|29)\./) File.open(ARGV[1], 'w') { |out| File.open(ARGV[0]).each_line { |line| next if r1.match(line) or r2.match(line) out.print(line) } } using strscan may give it another boost and running under ruby 1.7 may be faster still. I don't have java installed to compare the original... -joe