From: tamouse mailing lists Date: 2012-12-06T10:44:12+09:00 Subject: Re: Extract number (float) from string On Tue, Dec 4, 2012 at 1:50 PM, 7stud -- wrote: > str.match(/[.\d]+/)[0].to_f Interestingly, this works because of the way to_f interprets such things as: ".......".to_f # => 0.0 ".0.0.0.0.0.".to_f # => 0.0 both of which will also be caught by the regexp.