Help for this page
use warnings; use strict; ... my $str3 = "OUT(IN)OUT(IN)OUT(IN)(IN)OUT"; (my $z = $str3) =~ s/\(.*?\)//g; # $z is "OUTOUTOUTOUT"
use Regexp::Common qw/balanced/; my $str4 = "a(b(c(d)e)f)g(h(i(j)k)l)m"; (my $t = $str4) =~ s/$RE{balanced}{-parens=>'()'}//g; # $t is "agm"