Parses the description to the small and full description properties.

@param string The description line
164625
protected function parseDescription($descriptionLine)
    {
        if (strpos($descriptionLine, '*') <= 2) {
            $descriptionLine = substr($descriptionLine, (strpos($descriptionLine, '*') + 1));
        }

        //geen lege comment regel indien al in grote omschrijving
        if (trim(str_replace(array("\n", "\r"), array('', ''), $descriptionLine)) == '') {
            if ($this->obj->fullDescription == '') {
                $descriptionLine = '';
            }
            $this->smallDescriptionDone = true;
        }

        if (!$this->smallDescriptionDone) {
            //add to small description
            $this->obj->smallDescription .= $descriptionLine;
        } else {
            //add to full description
            $this->obj->fullDescription .= $descriptionLine;
        }
    }
817028
private function parseStringToArray($string)
    {
        // convert commas to spaces
        $string = str_replace(',', ' ', $string);
        // convert new lines to spaces
        $string = str_replace(PHP_EOL, ' ', $string);
        // split on the spaces and filter out empty elements
        return array_values(
            array_filter(
                array_map(
                    'trim',
                    explode(' ', $string)
                ),
                'strlen'
            )
        );
    }
1197150
public function setDescription($description)
    {
        if ($description !== null && strcmp($description, "") !== 0) {
            $this->description = (string) $description;
        } else {
            $this->description = null;
        }
    }
682207
protected function _parse($comment) {
		$summary = null;
		$description = null;
		$tags = array();

		$comment = trim(preg_replace('/^(\s*\/\*\*|\s*\*{1,2}\/|\s*\* ?)/m', '', $comment));
		$comment = str_replace("\r\n", "\n", $comment);

		if ($items = preg_split('/\n@/ms', $comment, 2)) {
			list($summary, $tags) = $items + array('', '');
			$this->_tags = $tags ? $this->_parseTags("@{$tags}") : array();
		}
		if (strpos($summary, "\n\n")) {
			list($summary, $description) = explode("\n\n", $summary, 2);
		}
		$this->_summary = $this->_clean($summary);
		$this->_description = $this->_clean($description);
	}
82054
public function readString($string)
    {
        if (!is_string($string))
            throw new IniReadingException('The expected type is string');

        // PHP 5.3.3, an empty line return is needed at the end.
        $string .= "\n";

        $data = @parse_ini_string($string, true);
        if ($data === false) {
            $e = error_get_last();
            throw new IniReadingException('Syntax error in INI configuration: ' . $e['message']);
        }

        $rawValues = @parse_ini_string($string, true, INI_SCANNER_RAW);

        return $this->toCollection($this->decode($data, $rawValues));
    }
784812
public function parseUrl($string)
    {
        $this->url = [];

        $url = parse_url($string);
        if (!$url || !isset($url['scheme'])) {
            throw new \Exception(sprintf('The url \'%s\' could not be parsed', $string));
        }

        $this->parseUrlArray($url);
    }
1013789
public static function parse($optionDescription) {
        $short    = null;
        $long     = null;
        $argcount = 0;
        $value    = false;

        $exp = explode('  ', trim($optionDescription), 2);
        $options = $exp[0];
        $description = isset($exp[1]) ? $exp[1] : '';

        $options = str_replace(',', ' ', str_replace('=', ' ', $options));
        foreach (preg_split('/\s+/', $options) as $s) {
            if (strpos($s, '--')===0) {
                $long = $s;
            }
            elseif ($s && $s[0] == '-') {
                $short = $s;
            }
            else {
                $argcount = 1;
            }
        }

        if ($argcount) {
            $value = null;
            if (preg_match('@\[default: (.*)\]@i', $description, $match))
                $value = $match[1];
        }
        return new static($short, $long, $argcount, $value);
    }
904861
private void parse(String s) {
    if (s != null) {
      for (MatchResult r = transformParseRegex.exec(s); r != null; r = transformParseRegex.exec(s)) {
        setFromString(vendorProperty(r.getGroup(1)), r.getGroup(2));
      }
    }
  }
922189
public function parse($description)
    {
        $prices = array();

        $possiblePriceDescriptions = preg_split('/\s*;\s*/', $description);

        try {
            foreach ($possiblePriceDescriptions as $possiblePriceDescription) {
                $price = $this->parseSinglePriceDescription($possiblePriceDescription);
                $prices += $price;
            }
        } catch (RuntimeException $e) {
            $prices = array();
        }

        return $prices;
    }
957762
protected function parseString(/*# string */ $string)/*# : array */
    {
        $regex =
        '~^\s*+
            (?:
                (?:([^#\s=]++) \s*+ = \s*+
                    (?|
                        (([^"\'#\s][^#\n]*?)) |
                        (["\'])((?:\\\2|.)*?)\2
                    )?
                ) |
                (?: (\.|source) \s++ ([^#\n]*) )
            )\s*?(?:[#].*)?
        $~mx';

        if (preg_match_all($regex, $string, $matched, \PREG_SET_ORDER)) {
            return $this->clearPairs($matched);
        } else {
            return [];
        }
    }
1077640
private function parse(string $value): void
    {
        // Check for castling:
        if (preg_match('/^(O-O|O-O-O)(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->castling = $matches[1];
            $this->check = $matches[2] === '+';
            $this->checkmate = $matches[2] === '#';
            $this->annotation = isset($matches[3]) ? $matches[3] : null;
            return;
        }

        // Pawn movement:
        if (preg_match('/^([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->targetColumn = $matches[1];
            $this->targetRow = (int)$matches[2];
            $this->check = $matches[3] === '+';
            $this->checkmate = $matches[3] === '#';
            $this->movedPiece = self::PIECE_PAWN;
            $this->annotation = isset($matches[4]) ? $matches[4] : null;
            return;
        }

        // Pawn movement (long san):
        if (preg_match('/^([a-h])([1-8])([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPieceDisambiguationColumn = $matches[1];
            $this->movedPieceDisambiguationRow = (int)$matches[2];
            $this->targetColumn = $matches[3];
            $this->targetRow = (int)$matches[4];
            $this->check = $matches[5] === '+';
            $this->checkmate = $matches[5] === '#';
            $this->movedPiece = self::PIECE_PAWN;
            $this->annotation = isset($matches[6]) ? $matches[6] : null;
            $this->longSan = true;
            return;
        }

        // Piece movement:
        if (preg_match('/^([KQBNR])([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = $matches[1];
            $this->targetColumn = $matches[2];
            $this->targetRow = (int)$matches[3];
            $this->check = $matches[4] === '+';
            $this->checkmate = $matches[4] === '#';
            $this->annotation = isset($matches[5]) ? $matches[5] : null;
            return;
        }

        // Piece movement from a specific column:
        if (preg_match('/^([KQBNR])([a-h])([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = $matches[1];
            $this->movedPieceDisambiguationColumn = $matches[2];
            $this->targetColumn = $matches[3];
            $this->targetRow = (int)$matches[4];
            $this->check = $matches[5] === '+';
            $this->checkmate = $matches[5] === '#';
            $this->annotation = isset($matches[6]) ? $matches[6] : null;
            return;
        }

        // Piece movement from a specific row:
        if (preg_match('/^([KQBNR])([0-9])([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = $matches[1];
            $this->movedPieceDisambiguationRow = (int)$matches[2];
            $this->targetColumn = $matches[3];
            $this->targetRow = (int)$matches[4];
            $this->check = $matches[5] === '+';
            $this->checkmate = $matches[5] === '#';
            $this->annotation = isset($matches[6]) ? $matches[6] : null;
            return;
        }

        // Piece movement from a specific column and row (long san):
        if (preg_match('/^([KQBNR])([a-h])([0-9])([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = $matches[1];
            $this->movedPieceDisambiguationColumn = $matches[2];
            $this->movedPieceDisambiguationRow = (int)$matches[3];
            $this->targetColumn = $matches[4];
            $this->targetRow = (int)$matches[5];
            $this->check = $matches[6] === '+';
            $this->checkmate = $matches[6] === '#';
            $this->annotation = isset($matches[7]) ? $matches[7] : null;
            $this->longSan = true;
            return;
        }

        // Pawn capture:
        if (preg_match('/^([a-h])x([a-h])([1-8])(?:=?([KQBNR]))?(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->targetColumn = $matches[2];
            $this->targetRow = (int)$matches[3];
            $this->movedPiece = self::PIECE_PAWN;
            $this->movedPieceDisambiguationColumn = $matches[1];
            $this->capture = true;
            $this->promotedPiece = $matches[4] ?: null;
            $this->check = $matches[5] === '+';
            $this->checkmate = $matches[5] === '#';
            $this->annotation = isset($matches[6]) ? $matches[6] : null;
            return;
        }

        // Pawn capture (long san):
        if (preg_match('/^([a-h])([1-8])x([a-h])([1-8])(?:=?([KQBNR]))?(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->targetColumn = $matches[3];
            $this->targetRow = (int)$matches[4];
            $this->movedPiece = self::PIECE_PAWN;
            $this->movedPieceDisambiguationColumn = $matches[1];
            $this->movedPieceDisambiguationRow = (int)$matches[2];
            $this->capture = true;
            $this->promotedPiece = $matches[5] ?: null;
            $this->check = $matches[6] === '+';
            $this->checkmate = $matches[6] === '#';
            $this->annotation = isset($matches[7]) ? $matches[7] : null;
            $this->longSan = true;
            return;
        }

        // Piece capture:
        if (preg_match('/^([KQBNR])x([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = $matches[1];
            $this->targetColumn = $matches[2];
            $this->targetRow = (int)$matches[3];
            $this->check = $matches[4] === '+';
            $this->checkmate = $matches[4] === '#';
            $this->capture = true;
            $this->annotation = isset($matches[5]) ? $matches[5] : null;
            return;
        }

        // Piece capture from a specific column:
        if (preg_match('/^([KQBNR])([a-h])x([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = $matches[1];
            $this->movedPieceDisambiguationColumn = $matches[2];
            $this->targetColumn = $matches[3];
            $this->targetRow = (int)$matches[4];
            $this->check = $matches[5] === '+';
            $this->checkmate = $matches[5] === '#';
            $this->capture = true;
            $this->annotation = isset($matches[6]) ? $matches[6] : null;
            return;
        }

        // Piece capture from a specific row:
        if (preg_match('/^([KQBNR])([0-9])x([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = $matches[1];
            $this->movedPieceDisambiguationRow = (int)$matches[2];
            $this->targetColumn = $matches[3];
            $this->targetRow = (int)$matches[4];
            $this->check = $matches[5] === '+';
            $this->checkmate = $matches[5] === '#';
            $this->capture = true;
            $this->annotation = isset($matches[6]) ? $matches[6] : null;
            return;
        }

        // Piece capture from a specific column and row (long san):
        if (preg_match('/^([KQBNR])([a-h])([0-9])x([a-h])([1-8])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = $matches[1];
            $this->movedPieceDisambiguationColumn = $matches[2];
            $this->movedPieceDisambiguationRow = (int)$matches[3];
            $this->targetColumn = $matches[4];
            $this->targetRow = (int)$matches[5];
            $this->check = $matches[6] === '+';
            $this->checkmate = $matches[6] === '#';
            $this->capture = true;
            $this->annotation = isset($matches[7]) ? $matches[7] : null;
            $this->longSan = true;
            return;
        }

        // Check for pawn promotion:
        if (preg_match('/^([a-h])([1-8])=?([KQBNR])(\+|\#?)(\?\?|\?|\?\!|\!|\!\!)?$/', $value, $matches)) {
            $this->movedPiece = self::PIECE_PAWN;
            $this->targetColumn = $matches[1];
            $this->targetRow = (int)$matches[2];
            $this->promotedPiece = $matches[3];
            $this->check = $matches[4] === '+';
            $this->checkmate = $matches[4] === '#';
            $this->annotation = isset($matches[5]) ? $matches[5] : null;
            return;
        }

        throw new InvalidArgumentException(sprintf(
            'The value "%s" could not be parsed.',
            $value
        ));
    }
355694
protected function parseDescription()
    {
        $description = $this->classReflection->getDescription() . chr(10) . chr(10);

        $description .= 'Implemented in: ``' . $this->className . '``' . chr(10) . chr(10);

        $helperName = $this->parseTitle();
        $helperInstance = new $this->className();

        $methods = $this->getHelperMethods();
        foreach ($methods as $methodReflection) {
            if (!$helperInstance instanceof ProtectedContextAwareInterface || $helperInstance->allowsCallOfMethod($methodReflection->getName())) {
                $methodDescription = $this->getMethodDescription($helperName, $methodReflection);
                $description .= trim($methodDescription) . chr(10) . chr(10);
            }
        }

        return $description;
    }
678954
private function parseHeaderLine($line)
    {
        $matches = [];
        if (preg_match('/^([^:]+):(.*)$/', $line, $matches) === 1) {
            $this->addHeader(trim($matches[1]), trim($matches[2]));
        }
    }
772179
public function parseAttributes($string)
    {
        $result = array();

        if (!empty($string))
        {
            $pattern = '#(?(DEFINE)
                (?<name>[a-zA-Z][a-zA-Z0-9-_:]*)
                (?<value_double>"[^"]+")
                (?<value_none>[^\s>]+)
                (?<value>((?&value_double)|(?&value_none)))
            )
            (?<n>(?&name))[\s]*(=[\s]*(?<v>(?&value)))?#xs';

            if (preg_match_all($pattern, $string, $matches, PREG_SET_ORDER))
            {
                foreach ($matches as $match) {
                    if (!empty($match['n'])) {
                        $result[$match['n']] = isset($match['v']) ? trim($match['v'], '\'"') : '';
                    }
                }
            }
        }

        return $result;
    }
234999
public function iShouldGetALogEntryContaining($string)
    {
        $found = false;
        foreach (explode("\n", $this->getOutput()) as $line) {
            if (strpos(trim($line), $string) !== false) {
                $found = true;
            }
        }

        if (!$found) {
            throw new \Exception(
                "Actual output is:\n" . $this->getOutput()
            );
        }
    }
668987
def normalize_description(description)
      # description could be another object not a string, but since it probably
      # serves the same purpose we could just as it to convert itself to str
      # and continue from there
      description = cleanup_string(description)
      return '' if description.blank?

      truncate(description, MetaTags.config.description_limit)
    end
631899
protected function _parseAttributes($string)
    {
        $result = array();

        if (!empty($string)) {
            $attr   = array();

            preg_match_all('/([\w:-]+)[\s]?=[\s]?"([^"]*)"/i', $string, $attr);

            if (is_array($attr)) {
                $numPairs = count($attr[1]);
                for ($i = 0; $i < $numPairs; $i++) {
                    $result[$attr[1][$i]] = $attr[2][$i];
                }
            }
        }

        return $result;
    }