str = "$6,178.50 USD / 22,693.01 AED"

regex = /
  \d
  [\d,.]*
/xms

str.scan(regex) do |match|
  puts match.gsub(',', '').to_f + 1
end

--output:--
6179.5
22694.01

-- 
Posted via http://www.ruby-forum.com/.