my $string = "testing, testing, 123"; my @captured = ($string=~/(testing)/g); print "captured: $_\n" for @captured;