[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: sscanf like in Lua
- From: Michal Kolodziejczyk <miko@...>
- Date: Tue, 24 Aug 2010 09:31:31 +0200
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