From: Max Williams Date: 2007-10-09T23:29:30+09:00 Subject: Re: regexp question - look for parentheses then remove them tho_mica_l wrote: > I'd also make the * non-greedy -> *? > > /\((.*?)\)/.match("3 * (1 + 2) * (3 + 4)")[1] > => "1 + 2" > > but: > /\((.*)\)/.match("3 * (1 + 2) * (3 + 4)")[1] > => "1 + 2) * (3 + 4" Excellent tip, cheers! -- Posted via http://www.ruby-forum.com/.