[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: how to translate lua pattern "(.*)and(.*)" with lpeg re ?
- From: Sean Conner <sean@...>
- Date: Sat, 20 Jan 2018 21:18:41 -0500
It was thus said that the Great albertmcchan once stated:
> looks like it is not easy to convert lua pattern "(.*)and(.*)" after all
>
> my last attempt, re.compile "{(!'and' .)*} 'and' {.*}" was close, but still wrong
>
> the re pattern correspond to lua pattern "(.-)and(.*)", not the greedy version.
You might want to read the thread starting here:
http://lua-users.org/lists/lua-l/2017-10/msg00126.html
I think relevant to your problem is this post:
http://lua-users.org/lists/lua-l/2017-10/msg00140.html
But the entire thread has a lot of information about LPeg and Lua patterns.
-spc