Hi,

what are the regexen for strings that can be converted to various types 
of numbers?

Or: how can the following be extended and/or corrected?

class String

   def to_number
     case self
       when /\A\d+\z/
         self.to_i
       when /\A[\d\.]+\z/
         self.to_f
       else
         self
     end
   end

end

TIA,
Tobi

-- 
http://www.pinkjuice.com/