in reply to Perl regex

If you use a regular expression you need to be aware that open and close square brackets are metacharacters so need to be escaped to match literally. You can use regex captures and a global match to pull out the items within the brackets.

use strict; use warnings; my $string = q{hereiam[[[one]]][[[two]]][[[three]]]wwhat}; my @strings = $string =~ m{\[+([^\]]*])\]+}g; print qq{@strings\n};

This produces

one two three

To make your posts easier to read you should surround code with <code> and </code> tags.

I hope this is of use.

Cheers,

JohnGG