From: MonkeeSage Date: 2006-09-29T18:45:11+09:00 Subject: Re: Regexp help Tom Armitage wrote: > But, of course, that *won't* capture "3m 2h", like you described... True... So: r = Regexp.new(/(\d+)h?m?.*(\d+)m?h?/) 'Course, then you'll have [3, 2] for the edge case rather than [2, 3]...but to get the full functionality that the OP described (including the case where just "2" is given), you'd need fancier logic than just regexp anyhow. Regards, Jordan