my @matches; for (@fields) { push @matches, /%%(\w+?)%%/g; }