[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string parsing vs hddtemp question
- From: Laurent Faillie <l_faillie@...>
- Date: Mon, 18 Mar 2013 15:25:44 +0100
Le 18/03/2013 12:44, Luiz Henrique de Figueiredo a écrit :
>> for _, mnt,tp,temp,unit in s:gmatch("((/dev/[^|]+)|([^|]+)|([^|]+)|([^|]+)[|]?[^/]+)") do
>> print(mnt, tp, temp, unit)
>> end
> The key to make this simpler is to make the string uniform by appending a
> separator at the end and to use - instead of +.
>
> s=s.."|"
> for mnt,tp,temp,unit in s:gmatch("|(.-)|(.-)|(.-)|(.-)|") do
> print(mnt, tp, temp, unit)
> end
>
Thanks to both of U : it's working very well thank you :)
But I still don't understand why my "(%a.+)" didn't work and extract the
remaining of the line.