matchCaptures

Match into a delegate.

bool
matchCaptures
(
S
R
Ret
Args...
)
(
S s
,
R r
,
Ret delegate
(
Args args
)
fun
)

Examples

assert("Mary has 5 apples"
	.matchCaptures(`^(\w+) has (\d+) (\w+)$`,
		(string name, int count, string fruit)
		{
			assert(name == "Mary" && count == 5 && fruit == "apples");
		}
	)
);

Meta