Park Heesob schrieb:
> str = "2h 3m" # or somthing
> str.scan(/(\d+)(\w*)/).sort_by{|x|x[1]}.collect{|x|x[0].to_i}

Very nice idea, Park! I wouldn't have thought of that. Slightly shorter:

   str.scan(/(\d+)(\w)/).sort_by{|n,u|u}.map{|n,u|n.to_i}

Regards,
Pit