lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


My strategy is to match more than you want and then filter the results in code:

local text = string.match(haystack, "^[fb][oa][or]$)
if text == "foo" then
  ...
elseif text == "bar" then
  ...
else
  -- no match
end

Takes a little preprocessing of the pattern but I prefer 100% lua code
over package dependencies any time and the Lua code is fairly trivial.

bye,
Wim