def METHOD_NAME(self, pattern, index=0):
    index += self.__position
    return (
        index >= 0
        and index < self.__input_length
        and bool(pattern.match(self.__input, index))
    )