lua-users home
lua-l archive

Re: LPEG primer

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


I too found LPEG mysterious at first. It took a lot of playing around
with it before it really made sense. The thing that confused me the
most was the V grammar rule function, but in the end I was over
thinking it. For someone who is not familiar with PEG and string
matching, the terminology looks really obscure. What I would suggest
is trying some really simple patterns without going in to grammars
until you feel more comfortable with LPEG. Try something dead simple
like matching patterns with 1 character, then 2 characters, then
generating a search in a larger string for those patterns. I think
this will help give you a taste of what LPEG is all about.
>From my experience, it's well worth investing the time to learn
something like LPEG. Once you get it, you can't go back :)
wes

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