in reply to Re^2: Parser Performance Question
in thread Parser Performance Question
Riddles are an efficient instrument for motivation in didactics. =)
For instance a friend of mine spends loads of time in hacker competitions... ;-)
> Do you mean "a\\"b"?
What do you think? xD
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
DB<103> '"a\\"b"' =~ / " (?: [^"] | \\" )* " /x ; print $& # + nonsense "a\" DB<104> '"a\\"b"' =~ / " (?: \\" | [^"] )* " /x ; print $& # + better "a\"b" DB<105> '"a\\"b"' =~ / " (?: \\\\ | \\" | [^"] )* " /x ; print $& # + best "a\"b"
Why #nonsense? Because the or-branch will never match, no matter which input.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Parser Performance Question (updated)
by Eily (Monsignor) on Oct 06, 2017 at 01:44 UTC | |
by LanX (Saint) on Oct 06, 2017 at 02:08 UTC | |
by Eily (Monsignor) on Oct 06, 2017 at 08:02 UTC | |
by LanX (Saint) on Oct 06, 2017 at 08:37 UTC | |
by Eily (Monsignor) on Oct 06, 2017 at 08:45 UTC | |
|