lua-users home
lua-l archive

Re: string parsing vs hddtemp question

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


2013年3月18日 Laurent Faillie <l_faillie@yahoo.com>:
> 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.
The culprit is .+, it will mean it will match one or more of any
characters. The + pattern is greedy, it will match as many characters
as possible. And that means it will match the whole input string in
the first gmatch match, rather than iterate over smaller parts like
you expected. You need to replace .+ with .- in your initial pattern.

AltStyle によって変換されたページ (->オリジナル) /