Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Latest commit

 

History

History
30 lines (19 loc) · 1.51 KB

README.md

File metadata and controls

30 lines (19 loc) · 1.51 KB

RegEx Lua

A runtime-agnostic RegEx interface for Lua.

license


This library provides a standard RegEx interface (mirroring the JavaScript API) and attempts to call out to native RegEx APIs if provided by the Lua runtime. If no native RegEx API is provided, it will fall back to an in-Lua RegEx implementation.

API

The API mirrors JavaScript (docs for which can be found here).

local RegEx = require(...)

-- NOTE: The multi-line string syntax is required to support the `\` syntax!
local myRe = RegEx.new([[/d(b+)d/]], "g");
local myArray = myRe:exec("cdbbdbsbz");

API Status

The following table shows which JavaScript RegExp features are supported in each runtime. If you require a specific RegEx feature and it is not supported then please submit and issue or make a pull request!

Runtime exec() test() match() matchAll() search() replace() replaceAll() split()
Fallback