D-Programming-Language/phobos — pull request #1958 by blackwhale (2014-02-22 20:31:15+00:00)
Title: fix issue 12076

Lookaround in ctRegex used wrong number of total captures thus missing
both a bit of optimization AND a special case of 0 matches.
The latter is the reason of range violation in issue 12076.

Also make ThompsonMatcher use the same scheme as backtracking matcher for lookaround. Take a slice of captures _before_ running engine not at the last point (i.e. successful match), makes code more straightforward as well.