lua-users home
lua-l archive
how to translate lua pattern "(.*)and(.*)" with lpeg re ?
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
how to translate lua pattern "(.*)and(.*)" with lpeg re ?
From
: albertmcchan <albertmcchan@
...
>
Date
: 2018年1月20日 17:08:56 -0500
local C, P = lpeg.C, lpeg.P
-- my attempt for lua pettern "(.+)and(.*)"
local lpeg_pat = C((P(1) - 'and')^1) * 'and' * C(P(1)^0)
local re_pat = re.compile "{ (. ! 'and')* . } 'and' {.*}"
-- lua pattern "(.*)and(.*)
lpeg_pat =
C((P(1) - 'and')^0) 'and' * C(P(1)^0)
-- what is lpeg re equivalent code ?
Follow-Ups
:
Re: how to translate lua pattern "(.*)and(.*)" with lpeg re ?
,
Sean Conner
Prev by Date:
Re: Upcoming changes in Lua 5.4
Next by Date:
Re: how to translate lua pattern "(.*)and(.*)" with lpeg re ?
Previous by thread:
Re: A proposal for the confusing pseudo table ≈ array concept
Next by thread:
Re: how to translate lua pattern "(.*)and(.*)" with lpeg re ?
Index(es):
Date
Thread
AltStyle
によって変換されたページ
(->オリジナル)
/
アドレス:
モード:
デフォルト
音声ブラウザ
ルビ付き
配色反転
文字拡大
モバイル