Pattern patternIndex of a TokenMatcher uses construct, which depends on the input after the token and so can't be matched by it: a lookahead other than the $/\Z/\z anchors. Returned by TokenMatcher.fromRegexesChecked; the other builders throw it as an IllegalArgumentException. Whole-string matching (Subset, CaptureMatcher) supports every lookahead.