From: Chris Morris Date: 2003-07-23T03:39:12+09:00 Subject: RegExp outermost () This may be a case where RegExp ain't the way to go, but I want to scan a string with nested paren groups and extract each outermost group. Is this best done in an RegExp? s = 'a group ( stuff ( other )) (( hey ( you ) (there) ) stuff )' magic_re = # ? s.scan(magic_re) { |match| puts match } output: ( stuff ( other )) (( hey ( you ) (there) ) stuff ) -- Chris http://clabs.org/blogki