From: 7stud -- Date: 2011-03-26T12:08:38+09:00 Subject: Re: Regexp, matching only the content within parentheses Robert K. wrote in post #989148: > On Fri, Mar 25, 2011 at 2:58 AM, 7stud -- > wrote: >> perl's regexes have a recursive feature, which can solve your problem. >> Want to call an external script? > > Not necessary: Ruby has it, too. > > irb(main):002:0> %r{(? \( (?:\g|[^()]+)* \) )}x > How come the perl regex uses the non-backtracking ++, and yours doesn't appear to do the equivalent? -- Posted via http://www.ruby-forum.com/.