
--------------------------------------------------------------------------------
-- LPeg RE module
--------------------------------------------------------------------------------

---@class re*
---@type re*
local M = {}

--- Compile RE syntax to LPeg pattern
---@param pattern string|any RE Expression or existing pattern
---@param defs? table additional definitions
---@return any compiled Compiled LPeg pattern
function M.compile(pattern, defs) end

--- match string
---@param subject string input string
---@param pattern string|any RE expression or pattern
---@param init? integer starting position
---@return any ... Match results
function M.match(subject, pattern, init) end

--- Find matching location
---@param subject string input string
---@param pattern string|any RE expression or pattern
---@param init? integer starting position
---@return integer? start starting position
---@return integer? finish end position
function M.find(subject, pattern, init) end

--- Replace matching content
---@param subject string input string
---@param pattern string|any RE expression or pattern
---@param repl string|number|table|function replacement value
---@return string result Replacement results
function M.gsub(subject, pattern, repl) end

--- Update locale predefined character classes
function M.updatelocale() end

return M
