From: Joel Pearson Date: 2013-06-10T20:00:29+09:00 Subject: Re: extract from output (regular expressions) This outputs it into a 2D Array and displays the results to the console, if that helps: require 'pp' pp File.foreach( 'test.txt' ).map do |line| if line =~ /^IP: / line.scan( /[\d.]+/ ) else nil end end.compact -- Posted via http://www.ruby-forum.com/.