local data = { [1]="atack", [2]="attack", [3]="attack with guns", [4]="attak w\o guns" }
function update(i)
result = {}
for k, v in pairs(data) do
if string.match(v, i) then
table.insert(result, v)
end
end
for k, v in pairs(result) do
print(v)
end
end
update('attack')