lua-users home
lua-l archive

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


On 23.08.2010 22:58, Enrico Colombini wrote:
> On 23/08/2010 22.07, Wesley Smith wrote:
>> don't forget that %d takes an int:
>>
>> v1, v2 = str:match("val (%d+) | (%d+)")
>> v1, v2 = tonumber(v1), tonumber(v2)
> 
> Wouldn't that miss the minus sign?
> (%-*%d+)

You probably meant: (%-?%d), because you would be interested in at most
one minus sign in the front of the number.

Regards,
	miko