@param $line

@return string
197560
protected static function getIndentation($line)
    {
        preg_match('/^\s*/', $line, $match);

        if (isset($match[0])) {
            $match[0] = trim($match[0], "\n\r");

            if (strlen($match[0]) > 0) {
                return $match[0];
            }
        }

        return '    ';
    }
451069
public static function getLineSlices(string $line)
    {
        preg_match('/^(\d+) (\w+) ([a-z0-9]+) +(\d+|-)\t(.*)$/', $line, $matches);
        $permissions = $matches[1];
        $type = null;
        switch ($matches[2]) {
            case NodeObject::TYPE_TREE:
                $type = NodeObject::TYPE_TREE;
                break;
            case NodeObject::TYPE_BLOB:
                $type = NodeObject::TYPE_BLOB;
                break;
            case NodeObject::TYPE_LINK:
                $type = NodeObject::TYPE_LINK;
                break;
        }
        $sha = $matches[3];
        $size = $matches[4];
        $fullPath = $matches[5];

        return [
            'permissions' => $permissions,
            'type'        => $type,
            'sha'         => $sha,
            'size'        => $size,
            'fullPath'    => $fullPath,
        ];
    }
1036389
protected function parseLine(string $line): string
    {
        if (!$this->isHiraganaCodePoints($line)) {
            throw new SyntaxException(_('ピクトセンスで使用可能の文字はひらがな、「ヴ」「ー」のみです。ただし、「ゔ」「ゕ」「ゖ」「𛀁」も使用できません: ') . $line);
        }
        
        if (mb_strlen($line, 'UTF-8') > self::WORD_MAX) {
            throw new SyntaxException(sprintf(_('「%1$s」は%2$d文字を越えています。'), $line, self::WORDS_MAX));
        }

        return str_replace('ヴ', 'ゔ', $line);
    }
791214
protected function parseExpressionLine( Line$line ):self
	{
		$content=  $line->slice(1);
		$ent_flag= var_export($this->htsl->getConfig('ENT_flags',$this->docType),true);
		$charset=   var_export($this->htsl->getConfig('charset'),true);

		return $this->openNode(new StringNode($this,$line))->appendLine("<?=htmlentities($content,$ent_flag,$charset,false)?>");
	}
995463
public function close( Line$closerLine ):string
	{
		if( isset($this->config['close_by']) && $closerLine->indentLevel==$this->line->indentLevel ){
			foreach( $this->config['close_by'] as $key=>$value ){
				if( $closerLine->pregMatch($key) ){
					return $this->withParam($value);
				}
			}
		}

		if( isset($this->config['closer']) )
			{ return $this->withParam($this->config['closer']); }

		return '';
	}
764940
private function escapeSpecialCharacters($line)
    {
        $line = $this->escapeFirstCharacters($line);

        $line = $this->escapeOtherCharacters($line);

        return $this->escapeOtherCharactersRegex($line);
    }
4751
protected static function parseLine( $line )
	{
		$pos	= strpos( $line, ":" );
		$name	= substr( $line, 0, $pos );
		$value	= substr( $line, $pos+1 );

		$params	= array();
		if( substr_count( $name, ";" ) )
		{
			$pos	= strpos( $name, ";" );
			$params	= substr( $name, $pos+1 );
			$name	= substr( $name, 0, $pos );
			$params	= explode( ",", utf8_decode( $params ) );
		}

		$parsed	= array(
			"name"	=> trim( $name ),
			"param"	=> $params,
			"value"	=> utf8_decode( $value ),
		);
		return $parsed;
	}
1240278
public function line($line)
    {
        $line = $this->client->get(
            sprintf('buckets/%d/chats/%d/lines/%d.json', $this->bucket, $this->parent, $line)
        );

        return new CampfireLine($this->response($line));
    }
857197
private function parseAnnotation($line) {
		// Let's get the annotation text
		preg_match("/^[@]([a-zA-Z][a-zA-Z0-9]*)(.*)/", $line, $values);
		
		$annotationClass = isset($values[1])?$values[1]:null;
		$annotationParams = trim(isset($values[2])?$values[2]:null);
		
		$this->annotationsArrayAsString[$annotationClass][] = $annotationParams;		
	}
942309
private function parseCsv($line): array
    {
        return str_getcsv(
            $line,
            $this->conversion['delimiter'],
            $this->conversion['enclosure'],
            $this->conversion['escape']
        );
    }
105317
private function chunk($line)
    {
        $width = $this->getWidth();
        if (mb_strlen($line) <= $width) {
            return [$line];
        }
        $stripped = $this->terminal->filter($line, static::REPLACEMENT_CHAR);
        $offset = 0;
        $out = [];

        for ($i = 0, $j = 0; $i <= mb_strlen($stripped); $i++) {
            if (mb_substr($stripped, $i, 1) != static::REPLACEMENT_CHAR) {
                if ($j > 0 && $j % $width == 0) {
                    $out[] = mb_substr($line, $offset, $i - $offset);
                    $offset = $i;
                }
                $j++;
            }
        }

        // return any remaining entries
        if ($offset != $i - 1) {
            $out[] = mb_substr($line, $offset);
        }
        return $out;
    }
1100203
private function getParamChunksFromLine($line)
    {
        $paramChunks = explode(' ', $line);
        $paramChunks = array_filter($paramChunks, function($val) {
            return $val !== '';
        });
        unset($paramChunks[0]);
        
        return $paramChunks;
    }
1029826
protected function parse_line($line)
    {
        $line = trim($line);
        if (empty($line)) {
            return null;
        }

        $fields = rcube_utils::explode_quoted_string(',', $line);

        // remove quotes if needed
        if (!empty($fields)) {
            foreach ($fields as $idx => $value) {
                if (($len = strlen($value)) > 1 && $value[0] == '"' && $value[$len-1] == '"') {
                    // remove surrounding quotes
                    $value = substr($value, 1, -1);
                    // replace doubled quotes inside the string with single quote
                    $value = str_replace('""', '"', $value);

                    $fields[$idx] = $value;
                }
            }
        }

        return $fields;
    }
763355
protected function parseColumnAlignments($line)
	{
		// Use a bitfield to represent the colons' presence and map it to the CSS value
		$align = [
			0b00 => '',
			0b01 => 'right',
			0b10 => 'left',
			0b11 => 'center'
		];

		$cols = [];
		preg_match_all('/(:?)-+(:?)/', $line, $matches, PREG_SET_ORDER);
		foreach ($matches as $m)
		{
			$key = (!empty($m[1]) ? 2 : 0) + (!empty($m[2]) ? 1 : 0);
			$cols[] = $align[$key];
		}

		return $cols;
	}
765228
private function escapeFirstCharacters($line)
    {
        $escapable = array('>', '- ', '+ ', '--', '~~~', '---', '- - -');

        foreach ($escapable as $i)
        {
            if (strpos(ltrim($line), $i) === 0)
            {
                // Found a character that must be escaped, adding a backslash before
                return '\\' . ltrim($line);
            }
        }

        return $line;
    }
215139
protected function parse_line($line) {
        $data = array();
        foreach ($line as $keynum => $value) {
            if (!isset($this->columns[$keynum])) {
                // This should not happen.
                continue;
            }

            $key = $this->columns[$keynum];
            $data[$key] = $value;
        }
        return $data;
    }
1298435
private function getFirstSegmentOfKey(Line $line)
    {
        // Remove first part since that part equals the page
        $key = substr($line->key, strpos($line->key, '.')+1);

        $length = strpos($key, '.')?: strlen($key);
        $key = substr($key, 0, $length);

        return $key;
    }