You could try the following (I'm not sure it will work 'cause I haven't tested it, but I think it will):
Code:
function getparams(text) {
_, _, match, match2 = string.find(text, "\"([^\"]+)\" \"([^\"]+)\"");
if match ~= nil then return match;
_, _, match, match2 = string.find(text, "\"([^\"]+)\" ([^\"]+)");
if match ~= nil then return match;
_, _, match, match2 = string.find(text, "([^\"]+) \"([^\"]+)\"");
if match ~= nil then return match;
_, _, match, match2 = string.find(text, "([^\"]+) ([^\"]+)");
if match ~= nil then return match;
retun nil;
}
Here is a link to the lua manual, where you may find other usefull information regarding pattern matching in lua (linked page and followups):
http://www.lua.org/pil/20.html