in reply to Repeatable regex.
In full snippet:my(@foundStrings) = ($myString =~ /"([^"]+)"/g);
By the way, if you'd prefer to have the " marks included in the resulting array I find this works.#!/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;
Funny how much power a couple of parens can have. Behold the power of Perl and be humbled. ;-)my(@foundStrings) = ($myString =~ /"[^"]+"/g);
Claude
|
|---|