lua-users home
lua-l archive

Re: Odd behavior with per cent signs (forked from Re: Feature request: plain option for gsub)

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


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)

AltStyle によって変換されたページ (->オリジナル) /