Regular expressionsReference
Regex:MatchMany
Collect all non-overlapping matches.
Details#
Collect all non-overlapping matches. A 1-based array of full matches; an empty array when none match. Capture groups are not separate results. Evaluation failure raises an error.
Signature#
regex:MatchMany(text: string): {string}Parameters#
| Parameter | Type | Description |
|---|---|---|
text | string | Text searched by the compiled expression. |
Returns#
A 1-based array of full matches; an empty array when none match. Capture groups are not separate results. Evaluation failure raises an error.
Examples#
Local example
local values = Regex.new("[0-9]+"):MatchMany("a12 b34")
print(values[1], values[2]) -- 12 34