x = [[a b c d e f g e b]]
res, _ = string.gsub(x, "%a b", "z")
print(res)