Please help with a string.gmatch problem I'm having

I thought I had a good grasp of regex until now....

I have a file that looks something like this:

"John Doe"=443,"Sue59"=550 .....

And it goes on.

These are pairs of values, so the 443 goes with John Dow, and 550 goes with Sue59.

I'm trying something like this:

for k, v in string.gmatch(content, "(%a+_%w+)=(%w+)") do
infoDB[i] = { k,v }
i = i + 1
end

But this is simply not working, it has problems with spaces, letters, numbers, etc. Can anyone tell where I'm going wrong here?

Of course, after typing it here, I figure it out.

The following worked for me, I just had to change my regex a little:

([a-zA-Z0-9_ \']+)=(%w+)

views:1294 update:2011/9/26 8:07:09
corona forums © 2003-2011