docs: def check(self, pattern):
          """
          Apply `pattern` on the current position and return
          the match object. (Doesn't touch pos). Use this for
          lookahead.
          """
          if self.eos:
              raise EndOfText()
          if pattern not in self._re_cache:
              self._re_cache[pattern] = re.compile(pattern, self.flags)
          return self._re_cache[pattern].match(self.data, self.pos)