Say, I have a line that contains the following string:
"$tom" said blah blah blash. "$dick" said "blah blah blah". "$harry" said blah blah blah.
and I want to extract
"$dick" said "blah blah blah"
I have the following code:
my ($term) = /(".+?" said ".+?")/g;
print $term;
But it gives me more than I need:
"$tom" said blah blah blash. "$dick" said "blah blah blah"
I tried grouping my pattern as a whole by using the non-capturing parens:
my ($term) = /((?:".+?" said ".+?"))/g;
But the problem persists.
I've reread the Nongreedy Quantifiers section of Learning Perl but it's got me nowhere so far.
Thanks for any guidance you can generously offer :)