extractCapture

Undocumented in source. Be warned that the author may not have intended to support it.
  1. alias extractCapture = extractCaptures
  2. auto extractCapture(S s, R r)
    extractCapture
    (
    S
    R
    )
    (
    S s
    ,
    R r
    )
    if (
    isSomeString!S
    )

Examples

auto s = "One 2 three 42";
auto r = `(\d+)`;
assert(s.extractCapture    (r).equal(["2", "42"]));
assert(s.extractCapture!int(r).equal([ 2 ,  42 ]));
auto s = "2.3 4.56 78.9";
auto r = `(\d+)\.(\d+)`;
assert(s.extractCapture!(int, int)(r).equal([tuple(2, 3), tuple(4, 56), tuple(78, 9)]));

Meta