lua-users home
lua-l archive

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


On Nov 16, 2007 3:52 PM, Duncan Cross <duncan.cross@gmail.com> wrote:
>
> On Nov 16, 2007 11:33 PM, Ken Smith <kgsmith@gmail.com> wrote:
> > On Nov 16, 2007 1:04 PM, Duncan Cross <duncan.cross@gmail.com> wrote:
> > > > In the second case, I expect to receive a table from the match but get
> > > > only the first field as a string.
> > >
> > > You should use lpeg.Ct instead of lpeg.C for this.
> >
> > Thanks for the response.  When I change
> >
> > lpeg.C((1 - lpeg.S',\n"')^0)
> >
> > to
> >
> > lpeg.Ct((1 - lpeg.S',\n"')^0)
> >
> > I get a table from record:match but the table is empty.  Is this not
> > what you meant?
>
> Sorry, my fault, I misread - try putting lpeg.Ct( ... ) around the
> following bit of record_lpeg, instead:
>
> field * (',' * field)^0

Beauty.  That does the trick.  Thank you.

   Ken