Regex:MatchMany
Returns every non-overlapping match in text.
Syntax
Regex:MatchMany(text: string) -> table
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | The text value to process. |
Returns
| Type | Description |
|---|---|
table | Every non-overlapping match in text |
Description
Regex:MatchMany is part of the Regex library. Regex wraps a compiled pattern object. Matching and replacement follow the module's regex engine rather than Lua patterns.
The call is read-only: it resolves the current value when invoked and does not change the underlying state.
Example
local re = Regex.new("(%a+)")
for _, match in ipairs(re:MatchMany("hello world")) do
print(match)
end
Notes
- Regex patterns use the module's engine; refer to its flag syntax rather than Lua patterns.