lua获取字符串中单引号之间的字符串
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
长风破浪会有时,直挂云帆济沧海!
可通过下方链接找到博主
https://www.cnblogs.com/judes/p/10875138.html