This is the LuLPeg library from https://github.com/pygy/LuLPeg but it has been gently hacked on to work with the Lua engine of ESO. The version of upstream LuLPeg is from commit ID a10d246 on November 22, 2018.
Here is a sample function using the 're' module, which provides a regex engine (see syntax here: http://www.inf.puc-rio.br/~roberto/lpeg/re.html ) -- this compiles and runs correctly in ESO.
Code:
local function do_regex()
local re = LibStub("LibLuLpeg").lib.re
-- find the position of the first numeral in a string
d(re.find("the number 423 is odd", "[0-9]+")) --> 12 14
-- returns all words in a string
d(re.match("the number 423 is odd", "({%a+} / .)*"))
-- > the number is odd
-- returns the first numeral in a string
d(re.match("the number 423 is odd", "s <- {%d+} / . s"))
-- > 423
d(re.gsub("hello World", "[aeiou]", "."))
-- > h.ll. W.rld
end
So, you can use either the RegEx-like engine of the "re" module (it isn't compliant with PCRE or anything but it's almost as expressive), or you can use LPEG, which is really flexible but a weird syntax.