lua-users home
lua-l archive

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


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