From: Ammar Ali Date: 2010-12-07T14:47:13+09:00 Subject: Re: Split version requirements On Tue, Dec 7, 2010 at 7:20 AM, Intransition wrote: > Of course, just my luck it doesn't work in Ruby 1.8 :-( I should have mentioned that. Just a thought, I suspect you might have already considered, why not just use match instead of split? >> /(\w+)\s+([>=<]\s*\d+\.\d+)\s+([>=<]\s*\d+\.\d+)/.match("rake > 0.8 < 1.0").captures [ "rake", "> 0.8", "< 1.0" ] Sure it's long and not as elegant as split, but it's clear, I think, explicit, and cross-version compatible. Regards, Ammar