Meh, this will teach me about posting when I can't test. I meant q< \\\\" >; but thought the \ wouldn't escape the next one. The case where the \ just before the " is litteral because escaped, so it can't escape the ".
use v5.20;
use Data::Dump qw( pp );
my $str = <<STR;
" .. \\\\" .. "
STR
print $str;
my %re = (LanX => qr/ " (?: \\\\ | \\" | [^"] )* " /x,
Eily => qr/ " (?: [^\\] | \\. )* " /x);
$str =~ /$re{$_}/ and say "$_ found $&" for keys %re;
" .. \\" .. "
Eily found " .. \\" .. "
LanX found " .. \\"
|