my $string = "testing, testing, 123"; my @captured = ($string=~/(testing)/g); print "captured: $_\n" for @captured; #### # match lowercase letters commas and space and get as many as possible (greedy) $string=~/([a-z,\s]+)/; # same but non-greedy (stop as soon as you can) $string=~/([a-z,\s]+?)/;