lua-users home
lua-l archive

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


Matthias Kluwe <mkluwe <at> gmail.com> writes:

> 
> Hi!
> 
> Dirk Laurie <dirk.laurie <at> gmail.com> writes:
> 
> > 2014/1/22 Matthias Kluwe <mkluwe <at> gmail.com>:
> > > I've found that
> > >
> > >     lpeg.match( 2 * lpeg.B'sd', 'asdf' )
> > >
> > > matches (and returns 3). If the "current position" is preceded by 'sd', it
> > > must be "before the 'f'"? But the call returns 3, which is the index
of the
> > > first character after the match, and that is the 'd'!?
> > 
> > I can't reproduce the reported behaviour.
> > 
> > $ lua -l lpeg
> > Lua 5.2.3  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> > > print(lpeg.version())
> > 0.12
> > > print(lpeg.match( 2 * lpeg.B'sd', 'asdf' ))
> > nil
> 
> Thank you for testing this!
> 
> I'm outdated -- my installed LPeg version is 0.10.2.

After updating to 0.12, the modified call

    lpeg.match( 2 * lpeg.B'as', 'asdf' )

yields 3, as expected.

Thank you again,
Matthias