Help for this page

Select Code to Download


  1. or download this
    my $c=0;
    s/ \(      (?{++$c})
     | \)      (?{--$c})
     | ([^()]+)
     /$1 if ($c==0)/gex;
    
  2. or download this
    s{([()]*)([^()]+)}
     {$c += $1=~y/(// - $1=~y/)//;
      $2 x !$c
     }ge;