local s = string.gsub(" and some text channel ", "^%s+%S+%s+(.*%S)%s+%S+%s+$", "%1") print(s)