http://www.perlmonks.org?node_id=571822


in reply to Re^2: Text::Balanced with nested / custom brackets
in thread Text::Balanced with nested / custom brackets

The function to extract tagged data can indeed be used.

my @links; my $extractor = gen_extract_tagged('[[', ']]', qr/(?:(?!\[\[).)*/); for (;;) { (my $link, $text) = $extractor->($text); last if not defined $link; push(@links, $link); }

Untested.