Does gmatch iterator finds all occurences immediately after it was called or does it try to find new occurence each iteration?
for elem in string.gmatch(s, pattern) do
...
end
It's important because it will be used a lot in my program, so if string.gmatch
just tries to find next occurence each iteration, it will be much more friendlier to performance.
string.gmatch
produces an iterator which finds the next match at each iteration.