Memoize Group#match, Repeat#match