local example = [[ "id":001 "id2":002 ]] for i,y in example:gmatch([["(%w+)"%s*:%s*(%d+)]]) do print(i, y) end