Help for this page
if ($text =~ /^ (?: # Any amount of: ... )* \] # Followed by a close brace /xs
my $next; while ( $next = (extract_bracketed($text,'[]','[^\[]*'))[0] ) ... print "found matching brackets: *$next*\n"; } print "found bracket error: $@\n" if $@;