|
local C, P = lpeg.C, lpeg.P 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 ? |