lua-users home
lua-l archive

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


Am Di., 27. Dez. 2022 um 11:38 Uhr schrieb Hartmut Henkel
<hartmut_henkel@gmx.de>:
>
> local h1, h2, h3 = string.match(s, "([^%-]+)%-([^%.]+)%.(.+)")

... just curiosity: Do you have any idea, how much time / RAM you need
for such a match / gsub construction with such more complicated
pattern search as in this example?

... or any "fast way" to get the "approximate time/RAM" consumption by
such a pattern search/match?

(you could also use something like s:sub( (s:find( '-', true))+1,
(s:find( '.', true))) - I wonder whether this would be faster or
slower...).