lua-users home
lua-l archive

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


On 17 November 2013 05:42, Laurent FAILLIE <l_faillie@yahoo.com> wrote:
> 2/ If I want to generalize, I got a set of strings link
>
>   Débit ATM              3939 kb/s          945 kb/s
>   Marge de bruit         8.10 dB            8.20 dB
>   Atténuation            56.00 dB           33.40 dB
>   FEC                    21976              196
>   CRC                    600                0
>   HEC                    38                 184
>
> I would like to retrieve :
> lab : the line label ('Débit ATM' or 'Marge de bruit', ...)
> val1 : first value
> val2 : second value.
>
> I played a long time with patterns without luck, so ...
>
> Thanks
>
> Laurent

local lab, val1, val2 = str:match("^(.-)%s%s+(%d+).-(%d+)")