1.程式碼
local str = "This is 'some' text with 'single quotes'." local pattern = "'(.-)'" local matches = {} for match in string.gmatch(str, pattern) do table.insert(matches, match) end for i, match in ipairs(matches) do print("Match " .. i .. ": " .. match) end