in reply to Re: Regex for outside of brackets
in thread Regex for outside of brackets

You can get the same output as in the second example by slightly modifying the substitution in the first example and calling it in a loop:
1 while s/\([^()]*\)//g;

To get the warnings, just check for remaining ( or ).

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^3: Regex for outside of brackets
by mr_mischief (Monsignor) on Jul 14, 2018 at 00:04 UTC

    My goal wasn't particularly to force them all to the same output. I'm yet to be sure what output OP wants beyond the single case of input. It was to demonstrate that there are multiple ways to do things, none of which are a single regular expression match. Thanks for helping expand on that.