protected static function compileValidPattern()
    {
        self::compileUnencodedCharacters();

        $valid_characters = self::$unreserved_pattern . self::$sub_delims_pattern;

        $ip_v_future_pattern = '\[[\:' . $valid_characters . ']+\]';

        $reg_name_pattern = '([' . $valid_characters . ']|' . self::$pct_encoded_pattern . ')*';

        self::$part_pattern = $ip_v_future_pattern . '|'. $reg_name_pattern;

        self::$valid_pattern = '/^$|^' . //allows part to be empty
            $ip_v_future_pattern . '$|^' . $reg_name_pattern . '$/';
    }