Regex module

find_all

procedureextension2 overloadsSource

Every match, left to right, not overlapping. An empty match right where the previous match ended is skipped, and in Unicode mode empty matches never split a UTF-8 sequence.

Example↗
Regex :: #import "Extensions/Regex";

re, _ := Regex.compile("[0-9]+");
matches := Regex.find_all(*re, "room 101, floor 3");
assert(matches.count == 2 && matches[1].text == "3");
array_free(matches);
Regex.free_regex(*re);
find_all :: (re: *Regex, text: string) -> [..] Match

Parameters

re: *Regex
text: string

Returns

[..] Match
find_all :: ($R: Type, text: string) -> [..] Match

Every match of the static pattern, as find_all does for a Regex.

Parameters

$R: Type
text: string

Returns

[..] Match
Example↗
Regex :: #import "Extensions/Regex";
Digits :: Regex.Static("[0-9]+");

assert(Regex.find_all(Digits, "1 22 333").count == 3);

See also