-- @runtimes lua54 luajit --- 演示:贪婪 * 与非贪婪 - 的差异。 local M = {} --- @return table { greedy = string, lazy = string } function M.run(log) log = log or print local text = "" local greedy = text:match("<(.*)>") local lazy = text:match("<(.-)>") log(("greedy=%s"):format(greedy)) log(("lazy=%s"):format(lazy)) return { greedy = greedy, lazy = lazy } end if not ... then M.run() end return M