[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPeg capture exclusion
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 3 Jul 2017 21:42:05 +0200
2017-07-03 21:35 GMT+02:00 Soni L. <fakedme@gmail.com>:
> That was a feature request. And that trick doesn't work for captures
> beyond 1 without introducing nils or a massive performance hit.
Would the requested feature make `pat/-2` drop the second capture
or the first two captures?
>
> On 2017-07-03 04:31 PM, Dirk Laurie wrote:
>>
>> No. But you can have it so `pat / drop` does that.
>>
>>
>> function drop(x,...) return ... end
>>
>> 2017-06-30 17:14 GMT+02:00 Soni L. <fakedme@gmail.com <mailto:fakedme@gmail.com>>:
>>
>> So uh can I have it so `pat / -1` removes capture 1 from pat,
>> while leaving all others untouched?