search/
Start typing to search packages!
package_2
regex
By @jsdotlua
Roblox
Mirrored
RegEx Lua
A runtime-agnostic RegEx interface for Lua.
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 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
Package Details
Install command (Click to copy)
Version
1.0.2
License
MIT
Safe for commercial use
Automated license review — not legal advice.
