From: 7stud -- Date: 2012-12-05T04:50:10+09:00 Subject: Re: Extract number (float) from string prices = [ '$ 5.99/LB', '$5.99 /LB', '5.99 / lb', ] results = prices.map do |str| str.match(/[.\d]+/)[0].to_f end p results --output:-- [5.99, 5.99, 5.99] -- Posted via http://www.ruby-forum.com/.