Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Parser Performance Question

by choroba (Cardinal)
on Oct 05, 2017 at 11:57 UTC ( [id://1200727]=note: print w/replies, xml ) Need Help??


in reply to Re: Parser Performance Question
in thread Parser Performance Question

Please, stop talking in riddles. Do you mean "a\\"b"?
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^3: Parser Performance Question (updated)
by LanX (Saint) on Oct 05, 2017 at 13:48 UTC
    > Please, stop talking in riddles.

    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!

    update

      The last two are still incorrect, as q< \\" > will be parsed as an escaped quote. /" (?: [^"\\] | \\. )* "/sx is the bestest solution :-P

      Edit: except when I'm an idiot and confuse (?= for (?:

        > q< \\" > will be parsed as an escaped quote

        I don't understand, it IS an escaped quote and it works for me:

        DB<175> $re = qr/ " (?: \\\\ | \\" | [^"] )* " /x; DB<176> p $a= q<x "..\\".." x> x "..\".." x DB<177> $a =~ /$re/; print $& "..\".."

        update

        maybe you should show us how you'd escape a double-quote.

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Je suis Charlie!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1200727]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 12:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found