
--------------------------------------------------------------------------------
-- LPeg RE module (with label error)
--------------------------------------------------------------------------------

---@class relabel*
---@type relabel*
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

--- Calculate the row number and column number corresponding to the position
---@param subject string input string
---@param index integer location
---@return integer line Line number
---@return integer column Column number
function M.calcline(subject, index) end

return M
