lua-users home
lua-l archive

Re: LPeg capturing too much?

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


Peter Odding wrote:
Hi all! I’m trying to write an LPeg parser for semi-structured text ala Textile & Markdown. It’s coming along very nicely: I think I’m almost done! However I’ve run into a pattern with LPeg that I can’t seem to get right. Quoting from my command-prompt: > = lpeg.match(lpeg.P'*' * lpeg.C((1 - lpeg.S'\r\n\f*')^1) * '*', '*emphasis*')
emphasis*
Did I mis-interpret the manual or is this a bug? Quoting part of the summary table from the LPeg manual:
 patt1 - patt2 Matches patt1 if patt2 does not match.
Hi Peter!
I interpret the manual like you, it should work. And it works correctly with lpeg 0.4 but not with 0.5!
So I think it's a bug in the 0.5 version.
BR
Michael

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