in reply to Repeatable regex.

I recall seeing some code that would "catch" all of the matches in an array. I don't recall the exact code. I've been playing around with different syntax. The example below seems to work okay.

my(@foundStrings) = ($myString =~ /"([^"]+)"/g);
In full snippet:
#!/usr/local/bin/perl use strict; my $myString ='stay "keep together" apart "and this" not'; print "\n$myString\n"; my (@foundStrings) = ($myString =~ /"([^"]+)"/g); foreach my $string (@foundStrings) { print "$string\n"; } exit;
By the way, if you'd prefer to have the " marks included in the resulting array I find this works.
my(@foundStrings) = ($myString =~ /"[^"]+"/g);
Funny how much power a couple of parens can have. Behold the power of Perl and be humbled. ;-)

Claude