Regex module

parse

procedureextensionSource

The whole of text against the pattern, with its named groups parsed.

Example↗
Regex :: #import "Extensions/Regex";
Time :: Regex.Static("(?<hour>[0-9]{2}):(?<minute>[0-9]{2})");

time, ok := Regex.parse(Time, "09:30");
assert(ok && time.hour == 9 && time.minute == 30);
_, ok = Regex.parse(Time, "at 09:30");
assert(!ok);
parse :: ($R: Type, text: string) -> (R.Groups, bool)

Parameters

$R: Type
text: string

Returns

R.Groups
bool

See also