5 lines
116 B
Perl
5 lines
116 B
Perl
use Regexp::Common 'balanced';
|
|
my $re = qr/^$RE{balanced}{-parens=>'[]'}$/;
|
|
sub balanced {
|
|
return shift =~ $re;
|
|
}
|