in reply to Re^5: Parser Performance Question (updated)
in thread Parser Performance Question
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 " .. \\"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Parser Performance Question (updated)
by LanX (Saint) on Oct 06, 2017 at 08:37 UTC | |
by Eily (Monsignor) on Oct 06, 2017 at 08:45 UTC | |
by LanX (Saint) on Oct 06, 2017 at 11:28 UTC | |
by Eily (Monsignor) on Oct 06, 2017 at 12:37 UTC | |
by LanX (Saint) on Oct 06, 2017 at 13:40 UTC | |
| |
by songmaster (Beadle) on Oct 20, 2017 at 01:37 UTC | |
by LanX (Saint) on Oct 06, 2017 at 10:48 UTC |