1 my $string = '"hello there", said Pooh, "how are you today?". I said "brilliant!".';
2 print "$string\n";
3 $string =~ s/('|")(.*?)\1/$1.uc($2).$1/ge;
4 print "$string\n";
I want to change letters in ' or '' to be uppercase. Without the ? the result will not be correct. Note that * is greedy and ? is not greedy.