in reply to Re: Regex - backreferencing multiple matches in one group.
in thread Regex - backreferencing multiple matches in one group.

So, this is either non-responsive (since I'm not using regexes) or one of those "hey, I never thought of that" situations. A cheater approach to this problem is to use 'split':
use strict; use warnings; my $input = "!Frequency[A][B][C] ..some other text.."; $input =~ s/^!//; # dump that leading '!' print "'$input'\n"; my @pieces = split(/[\]\[]+/, $input); foreach my $piece (@pieces) { print "PIECE '$piece'\n"; }