{"action":"opened","issue":{"url":"https://api.github.com/repos/wiremod/wire/issues/1185","repository_url":"https://api.github.com/repos/wiremod/wire","labels_url":"https://api.github.com/repos/wiremod/wire/issues/1185/labels{/name}","comments_url":"https://api.github.com/repos/wiremod/wire/issues/1185/comments","events_url":"https://api.github.com/repos/wiremod/wire/issues/1185/events","html_url":"https://github.com/wiremod/wire/issues/1185","id":165950895,"number":1185,"title":"E2: gmatch function(s) return an array or table?","user":{"login":"CaptainPRICE","id":9789070,"avatar_url":"https://avatars.githubusercontent.com/u/9789070?v=3","gravatar_id":"","url":"https://api.github.com/users/CaptainPRICE","html_url":"https://github.com/CaptainPRICE","followers_url":"https://api.github.com/users/CaptainPRICE/followers","following_url":"https://api.github.com/users/CaptainPRICE/following{/other_user}","gists_url":"https://api.github.com/users/CaptainPRICE/gists{/gist_id}","starred_url":"https://api.github.com/users/CaptainPRICE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CaptainPRICE/subscriptions","organizations_url":"https://api.github.com/users/CaptainPRICE/orgs","repos_url":"https://api.github.com/users/CaptainPRICE/repos","events_url":"https://api.github.com/users/CaptainPRICE/events{/privacy}","received_events_url":"https://api.github.com/users/CaptainPRICE/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-16T22:43:51Z","updated_at":"2016-07-16T22:43:51Z","closed_at":null,"body":"[string:gmatch](https://github.com/wiremod/wire/blob/b489718b94182a4a6c3a52cf7b7ffb5a49f8b544/lua/entities/gmod_wire_expression2/core/string.lua#L435-L478)\r\n\r\ns:gmatch(s) docs:\r\n> runs string.gmatch(S, S2) and returns the captures in an array\r\n\r\ns:gmatch(s,n) docs:\r\n> runs string.gmatch(S, S2, N) and returns the captures in an array\r\n\r\nTest code:\r\n```\r\n@outputs Str:string [Gmatch,TypeIDs]:table\r\n\r\nStr = \"Ceca\"\r\n\r\nGmatch = Str:gmatch(\"[0-9A-Fa-f][0-9A-Fa-f]\")\r\n#[\r\n1:\r\n\t\t1\t=\tCe\r\n2:\r\n\t\t1\t=\tca\r\n]#\r\nprintTable(Gmatch)\r\n\r\nprint(\"____________________\")\r\n\r\nTypeIDs = Gmatch:typeids()\r\n#[\r\n1\t=\tr\r\n2\t=\tr\r\n]#\r\nprintTable(TypeIDs)\r\n\r\n# So, it is an array? Let's check.\r\nforeach (Index, Value:array = Gmatch)\r\n{\r\n    print(_HUD_PRINTTALK, Index, Value)  # Nothing.\r\n}\r\n# Nope. Nothing happened.\r\n\r\n# Perhaps it is a table?\r\nforeach (Index, Value:table = Gmatch)\r\n{\r\n    print(_HUD_PRINTTALK, Index, Value)  # Nothing.\r\n}\r\n# Damn it Divran.\r\n```\r\n\r\nOutput:\r\n> 1:\r\n> \t\t1\t=\tCe\r\n> 2:\r\n> \t\t1\t=\tca\r\n> ____________________\r\n> 1\t=\tr\r\n> 2\t=\tr\r\n"}}
{"actor":{"display_login":"CaptainPRICE"}}