$_="..............."; ($re=$_)=~s#(()|()|.)#${[')','']}[!$3]\Q$1\E${['(','']}[!$2]#gs; print join "\n",eval{/$re/}; die $@ if $@=~/unmatched/i;