From: Tobias Reif Date: 2002-01-11T00:58:17+09:00 Subject: regexen for strings that can be converted to numbers 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/