-- gmatch returns an iterator over pattern matches local s = "a,bb,ccc" for field in string.gmatch(s, "[^,]+") do print(field) end
string.gmatch yields each match