From: Vincent Fourmond Date: 2006-09-29T19:28:02+09:00 Subject: Re: Regexp help > And the one-liner : > > $ irb >>> "3m > 2h".scan(/(\d+)h.*(\d+)m|(\d+)m.*(\d+)h/).flatten.values_at(0,1,3,2).compact That's a nice one ! Vince