Balanced brackets: Difference between revisions
m
→{{header|Perl}}: use Regexp::Common subroutine interface, works with recent versions of Perl
VincentARM (talk | contribs) (Add task to aarch64 assembly raspberry pi) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: use Regexp::Common subroutine interface, works with recent versions of Perl) |
||
Line 5,897:
}</syntaxhighlight>
<code>Regexp::Common::balanced</code> can give such a regexp too (
<syntaxhighlight lang="perl">use Regexp::Common '
sub balanced {
return shift =~
}
Alternative implementation, using straightforward depth counting:
|