<code>$_ = "{a}{{b}}{{c}{{d}}}"; ($re=$_)=~s/((\{)|(\})|.)/${['(','']}[!$2]\Q$1\E${[')','']}[!$3]/gs; @$ = (eval{/$re/},$@); print join"\n",@$ unless $$[-1]=~/unmatched/;
In reply to Re: Balancing braces without (??{})
by I0
in thread Balancing braces without (??{})
by tshabet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |