[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [mind game] Seeking for simple task impossible via regexps
- From: "Soni L." <fakedme@...>
- Date: Fri, 24 Feb 2017 15:23:06 -0300
On 24/02/17 03:18 PM, Coda Highland wrote:
On Fri, Feb 24, 2017 at 9:18 AM, Roberto Ierusalimschy
In layman's terms, this means that there are languages that LPeg can
parse that PCRE cannot. (For example, PCRE cannot parse the balanced
parentheses language without calling out to Perl code.)
PCRE (and the Perl engine) can parse the balanced parentheses
language. Check for "(?R)".
Oh. Huh. I actually went and tried to research it before I posted
that, and I hadn't found a solution using that technique. TIL, I
guess! Though that's only supported by Perl, Ruby, and libpcre, not by
I don't know if there's a concrete answer to whether a regular
language with recursion is as powerful as a nondeterministic pushdown
automaton. My intuition says that they're equivalent to deterministic
PDAs, which are known to be strictly weaker than NPDAs, but in terms
of real-world parsing tasks I'm not certain if that ends up mattering.
Can you parse HTML with LibPCRE?
I think that'd answer your question.
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.