[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Multiple captures with patt/function in LPEG
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 29 Aug 2014 09:16:15 +0200
2014-08-29 8:54 GMT+02:00 Coroutines <coroutines@gmail.com>:
> On Thu, Aug 28, 2014 at 11:42 PM, Paul K <paul@zerobrane.com> wrote:
>> lpeg.match(((lpeg.Cp() * lpeg.R('04')) / print)^1, "4123")
>>
>> Why don't I get
>> 1 4
>> 2 1
>> 3 2
>> 4 3
> try this? lpeg.match(((lpeg.Cp() * lpeg.C(lpeg.R('04'))) / print)^1, "4123")
Equivalently:
lpeg.match(((lpeg.Cp() * (lpeg.R'04'/1)) / print)^1, "4123")