[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Odd behavior with per cent signs (forked from Re: Feature request: plain option for gsub)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 22 Aug 2014 11:35:52 +0200
2014-08-22 11:26 GMT+02:00 Sean Conner <sean@conman.org>:
> I forgot that when you do:
>
> pattern / "string"
>
> that "string" could contain backreferences in the form of "%1, %2". It's
> not a feature I use that often in LPeg.
Oh! I use it all the time. But then, I use LPeg almost exclusively for
translating my little DSL's (e.g. APL) into Lua code. That feature allows
one to do everything in a single grammar.
local lua,pos = (apl_expr*_s^0*Cp()):match(apl)