From: William James Date: 2005-12-21T21:57:48+09:00 Subject: Re: Regex with multiple returns Robert Klemme wrote: > 'boringstuff(returnthisplease)notthis(butthis)dontwantthis(butIdowantthisn > omatterhowmanyparenthiesisthereare)'.scan(/\(([^)]*)\)/).map {|m|m[0]} > => ["returnthisplease", "butthis", > "butIdowantthisnomatterhowmanyparenthiesisthereare"] > > robert p "junk(keep)trash(this)detritus(text)".scan(/\((.*?)\)/).flatten