Because you only have one pair of parentheses, you'll only get $1 defined. A way that you can catch all your matches would be something like this:
Then the array @matches will contain all of the matches and you can step through them if you want by using indices to access @matches. Please note to use the /g modifier at the end of the regex to find every possible match.my @matches = ($a =~ m/(\[\[.*?\]\])/g);
kelan
Perl6 Grammar Student
In reply to Re: Regular Expression Pieces
by kelan
in thread Regular Expression Pieces
by Angel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |