lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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")