[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: gmatch problem
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 30 Mar 2017 10:12:48 -0300
> local str=" A1 blah AA boo Ax "
> 
> local function getCase(A,str)
>   local nextCase = string.gmatch(str,"%u%w")
>   local N=nextCase()
>   while N ~=  nil do
>   --  if type(Q[N]) == 'table' then A[N] = #Q[N] end
      print(N)
>     N=nextCase()
>   end
>   return A
> end
With this small change, the call 'getCase(nil, str)' prints A1, AA, and
Ax in my machine. I don't think you have a "gmatch problem"; the problem
seems to be somewhere else.
-- Roberto