[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lost (again) with strings patterns
- From: Choonster TheMage <choonster.2010@...>
- Date: Sun, 17 Nov 2013 05:55:29 +1100
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+)")