in reply to Re^2: balanced parens regexp hangs
in thread balanced parens regexp hangs - solved

Actually I meant (?>(?>[^{}]*)|\{(??{$parens})\})*, since I don't see a reason why any of these groups should ever give up something that they successfully matched.

For an explanation of (?>...) see How backtracking works in regular expressions and Avoiding regex backtracking.

Replies are listed 'Best First'.
Re^4: balanced parens regexp hangs
by grizzley (Chaplain) on Mar 27, 2009 at 10:10 UTC
    I agree. Thanks again!