rex.new
Lua function

rex.new

Summary

Compiles a regular expression

Prototype

re = rex.new (pattern, flags)



Description

This compiles a pattern, returning a regular expression object that can be used to test regular expressions. For example:


re = rex.new ("(.+) goes (.+)")


Flags are optional. If you want to use them you can use the rex.flags () function to convert various flags into numbers.



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_rex Lua PCRE regular expression 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)

(Help topic: lua=rex.new)

DOC_contents Documentation contents page