1 2 3 4 5
local a = "123456789" for mat in string.gmatch(a,"(%d%d%d%d-)") do print(mat) end
1 2 3
123 456 789