Lua PCRE regular expression functions
PCRE regular expression functions (rex)

The functionality of the PCRE (Perl Compatible Regular Expression) library is available to Lua scripts.

This is exactly the same regular expression matching that is done in triggers and alias matching.

First you create (compile) a regular expression into a rex object using rex.new.

Once the object is compiled you can repeatedly match it against target strings using re:match, re:gmatch, and re:exec (where "re" is the name of the compiled object).


See Also ...

Topics

DOC_lua_base Lua base functions
DOC_lua_bc Lua bc (big number) functions
DOC_lua_bit Lua bit manipulation functions
DOC_lua_coroutines Lua coroutine functions
DOC_lua_debug Lua debug functions
DOC_lua_io Lua io functions
DOC_lua_math Lua math functions
DOC_lua_os Lua os functions
DOC_lua_package Lua package functions
DOC_lua Lua script extensions
DOC_lua_string Lua string functions
DOC_lua_tables Lua table functions
DOC_lua_utils Lua utilities
DOC_scripting Scripting

Lua functions

LUA_re:exec re:exec (Matches a regexp to a string, returning offsets)
LUA_re:gmatch re:gmatch (Matches a regexp to a string, applying a function)
LUA_re:match re:match (Matches a regexp to a string)
LUA_rex.flags rex.flags (Returns a table of PCRE flags)
LUA_rex.new rex.new (Compiles a regular expression)

(Help topic: general=lua_rex)

DOC_contents Documentation contents page