public function collapseStartingRepetition($string)
    {
        $matches = array();
        $pattern = "/^[" . preg_quote($string, "/") . "]+(?P<remainder>.*)/";

        $starts_with_string = preg_match($pattern, $this->string, $matches);

        if ($starts_with_string) {
            $collapsed_string = $string . $matches["remainder"];

            return $collapsed_string;
        } else {
            return $this->string;
        }
    }