2 local match = string.match;
7 if not jid then return; end
8 -- TODO verify JID, and return; if invalid
9 local node = match(jid, "^([^@]+)@");
10 local server = (node and match(jid, ".-@([^@/]+)")) or match(jid, "^([^@/]+)");
11 local resource = match(jid, "/(.+)$");
12 return node, server, resource;