in reply to Re^2: bracket processing (updated)
in thread bracket processing

I can only generate the given output when I add the -keep switch to the RE_balanced() call.

What version are you using? From Regexp::Common::balanced:

Since version 2013030901, $1 will always be set (to the entire matched substring), regardless whether {-keep} is used or not.