The OpenD Programming Language

Captures.whichPattern

Number of pattern matched counting, where 1 - the first pattern. Returns 0 on no match.

struct Captures(R)
@safe @property const nothrow
int
whichPattern
()

Examples

import std.regex;
assert(matchFirst("abc", "[0-9]+", "[a-z]+").whichPattern == 2);

Meta