def METHOD_NAME(self, pattern):
    pattern_match = None
    if self.hasNext():
        pattern_match = pattern.METHOD_NAME(self.__input, self.__position)
        if bool(pattern_match):
            self.__position = pattern_match.end(0)
    return pattern_match