in reply to Regex, how to pull out multiple matches per line into array?

The matching in list context returns the matching groups ($1, $2...), which are created by parentheses in the regular expression. You should add another pair of them that spans the whole macro, you should also turn the inner group into a non-matching one so it doesn't pollute the results:
#!/usr/bin/perl use warnings; use strict; my @inarr = ( 'stuff{tag}<igo;123>stuff<ig;abc>', '<igt;ddd>stuff blah {foo}', 'stuff blah foo <igxo;dsldkd.eps>', '<igt;aaa>stuff blah <igx;hhh>', ); my $re = qr/( < (?: ig | igt | igo | igxo ) ; .+? > )/x; for my $lin (@inarr) { my @g = $lin =~ m/$re/g; print join ' ', map "[$_]", @g; print "\n"; }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ