I'm really struggling with this.. I'm trying to get only the first 2 per line in the string printed but it doesn't work perfectly
local pattern = "(%w+)%s?(%w+).-%d+"
local get = [[Start Tackle Normal Physical 50 100% 35
Start Harden Normal Status ? ?% 30
Start Headbutt Normal Physical 70 100% 15]]
for level, move in get:gmatch(pattern) do
print(level.." "..move)
end
Here is my output:
Start Tackle
10 0
Start Harden
Start Headbutt
10 0
It should only be
Start Tackle
Start Harden
Start Headbutt

1 comment
oh thanks! I didn't know \n could be used in Lua!