let b = @[0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5]
type A = 2..4
match(b):
of @[*_, *A @t, *_, A @u, *_]:
assert t == @[2, 3, 4]
assert u == 2
Like in regular expressions.
Even a limited version - just skipping (*_) at beginning, skipping at the end,
and multi-capture between - would be of much value,
and in such version it doesn't need re-matching (i.e. trying other combination after failure).
Like in regular expressions. Even a limited version - just skipping (
*_
) at beginning, skipping at the end, and multi-capture between - would be of much value, and in such version it doesn't need re-matching (i.e. trying other combination after failure).