Help for this page

Select Code to Download


  1. or download this
    $_ = '(()(()()))';
    (my $re=$_)=~s/((\()|(\))|.)/${[')','']}[!$3]\Q$1\E${['(','']}[!$2]/gs
    +;
    eval{/$re/};
    print "Balanced" unless $@ =~ /unmatched/;