in reply to Re^7: Parser Performance Question (updated)
in thread Parser Performance Question
Hu, how did I ever reach sainthood in our book? Eily => qr/ " (?: [^"\\] | \\. )* " /x); <= added the missing " in the character class
use Data::Dump qw( pp ); my $str = <<STR; " .. \\" .. STR print $str; my %re = (LanX => qr/ " (?: \\\\ | \\" | [^"] )* " /x, Eily => qr/ " (?: [^"\\] | \\. )* " /x); $str =~ /$re{$_}/ and say "$_ found $&" or say "$_ found nothing" for +keys %re;
" .. \" .. Eily found nothing LanX found " .. \"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Parser Performance Question (Atomic grouping)
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 Eily (Monsignor) on Oct 06, 2017 at 14:03 UTC | |
by songmaster (Beadle) on Oct 20, 2017 at 01:37 UTC | |
|
Re^9: Parser Performance Question
by LanX (Saint) on Oct 06, 2017 at 10:48 UTC |