mirror of
https://github.com/lune-org/lune.git
synced 2025-03-04 11:11:39 +00:00
16 lines
416 B
Lua
16 lines
416 B
Lua
![]() |
--!nolint
|
||
|
|
||
|
local regex = require("@lune/regex")
|
||
|
|
||
|
local re = regex.new("[0-9]+")
|
||
|
assert(tostring(re) == "Regex([0-9]+)")
|
||
|
assert(typeof(re) == "Regex")
|
||
|
|
||
|
local mtch = re:find("1337 wow")
|
||
|
assert(tostring(mtch) == "RegexMatch(1337)")
|
||
|
assert(typeof(mtch) == "RegexMatch")
|
||
|
|
||
|
local captures = re:captures("1337 125600 wow! 1984 0")
|
||
|
assert(tostring(captures) == "RegexCaptures(3)")
|
||
|
assert(typeof(captures) == "RegexCaptures")
|