match_keys - Return target:value for keys that match the specified
pattern
strtbl
match_keys( pattern, domain )
This function can be used to retrieve multiple domain:value entries where
domain:key=value matches for some specific pattern for key (where % is used as
wildcard, SQL style). The optional domain argument can be set to
KEY_CONFIG or to KEY_TARGET but defaults to the appl- specific
key-value store.
function match_keys0()
for i,v in ipairs(match_keys("%", KEY_CONFIG)) do
print(i, v);
end
for i,v in ipairs(match_keys("%")) do
local pos, stop = string.find(v, "=", 1);
local key = string.sub(v, 1, pos - 1);
local val = string.sub(v, stop + 1);
print(key, val);
end
end