Parse line separated text string

@param string $string
@return bool
433263
protected function parseString($string)
    {
        if (!isset($this->config['strict']) || $this->config['strict'] !== false) {
            // Strings are not part of any documented sitemap standard
            return false;
        }
        $array = array_filter(array_map('trim', mb_split('\r\n|\n|\r', $string)));
        foreach ($array as $line) {
            if ($this->isSitemapURL($line)) {
                $this->addArray(self::XML_TAG_SITEMAP, ['loc' => $line]);
                continue;
            }
            $this->addArray(self::XML_TAG_URL, ['loc' => $line]);
        }
        return true;
    }
1096324
final public function hasOperator($string)
    {
        $string = trim($string);
        //echo $string;
        $matches = array();
        if (!preg_match("/(\<|>|!|=|is null|BETWEEN|is not null)/i", $string, $matches)) {
            return FALSE;
        }
        return TRUE;
    }
369868
public function parse($str)
    {
        $this->removeBom($str);

        $data = $this->createM3uData();
        $lines = \explode("\n", $str);

        for ($i = 0, $l = \count($lines); $i < $l; ++$i) {
            $lineStr = \trim($lines[$i]);
            if ('' === $lineStr || $this->isComment($lineStr)) {
                continue;
            }

            if ($this->isExtM3u($lineStr)) {
                $tmp = \trim(\substr($lineStr, 7));
                if ($tmp) {
                    $data->initAttributes($tmp);
                }
                continue;
            }

            $data->append($this->parseLine($i, $lines));
        }

        return $data;
    }
1076115
public function parseString($string)
    {

        $stringHelper = $this->container->get('opifer.content.string_helper');

        $string = $stringHelper->replaceLinks($string);

        return $string;
    }
1117304
public function parseComments($string)
	{
		$return = '';
		$multiLineComment = false;
		$lines = preg_split('/[\r\n]/', $string);

		foreach ($lines as $key => $line) {
			if (preg_match('/#\s.*/', $line)) {
				$return .= str_replace('# ', "// ", $line) . "\n";
			} elseif ($line != '') {
				if (!$multiLineComment) {
					$multiLineComment = true;
					$return .= '/**';
				}
				$return .= "\n * {$line}";
			}
		}

		if ($multiLineComment) {
			$return .= "\n */\n";
		}

		return $return;
	}
162895
public function parseString($string)
    {
        //argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        foreach ($this->data as $key => $value) {
            $string = str_replace($key, $value, $string);
        }

        return $string;
    }
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 [];
        }
    }
586736
protected function _parse_string($string, $single_trim = false) {
    if ($single_trim) {
      $string = preg_replace("/^[\"\']/", "", $string);
      $string = preg_replace("/[\"\']$/", "", $string);
    }
    else {
      $string = trim($string, "'\"");
    }
    
    $string = str_replace(array("\\\n",'\\"',"\\'"),
                          array("",'"',"'"), $string);

    // Convert escaped hex characters into ascii characters (e.g. \A => newline)
    $string = preg_replace_callback("/\\\\([0-9a-fA-F]{0,6})(\s)?(?(2)|(?=[^0-9a-fA-F]))/",
                                    create_function('$matches',
                                                    'return chr(hexdec($matches[1]));'),
                                    $string);
    return $string;
  }
297515
private static function linebreakSplit($text)
    {
        $lines = [];
        $line = '';

        foreach (Multibyte::split('([\r\n]+)', $text, -1, PREG_SPLIT_DELIM_CAPTURE) as $part) {
            $line .= $part;
            if (Multibyte::trim($part) === '') {
                $lines[] = $line;
                $line = '';
            }
        }
        $lines[] = $line;

        return $lines;
    }
935971
public function split($text) {
        if (count($this->patterns) === 0) {
            return false;
        }
        if ($this->concatenatedPatterns === null) {
            $this->concatenatedPatterns = '/' . implode('|', array_map(function ($pattern) {
                    return $pattern['pattern'];
                }, $this->patterns)) . '/msSi';
        }

        if (!preg_match($this->concatenatedPatterns, $text, $matches)) {
            return false;
        }

        $match = array_shift($matches);
        $patternNo = count($matches) - 1;
        $childRuleName = $this->patterns[$patternNo]['childRuleName'];
        list($first, $end) = preg_split($this->patterns[$patternNo]['pattern'] . 'msSi', $text, 2);

        return [$first, $match, $end, $childRuleName];
    }
1077568
function _getValue($string)
	{
		if (preg_match('/value=("([^"]*)"|\'([^\']*)\'|[^>\s]*)([^>]*)?>/is', $string, $match)) {
			$val_match = trim($match[1]);
			$val_match = trim($val_match, '"\'');
			unset($string);
			return $val_match;
		}
		return false;
	}
677497
public function parse(string $text)
    {
        try {
            $result = $this->syntax->parse($text);
            $this->success = true;
        } catch (ParseException $e) {
            $result = $this->default;
            $this->success = false;
        }

        return $result;
    }
639702
protected function splitItems($string)
    {
        return strpos($string, $this->separator) !== false ? explode($this->separator, $string) : [$string];
    }
900947
private function parse($string)
    {
        $params = explode(PHP_EOL, trim($string));
        $result = [];

        foreach ($params as $param) {
            $parts = explode(':', $param);
            $result[$parts[0]] = trim($parts[1]);
        }

        return $result;
    }
1307699
public function parse($string)
    {
        try {
            return parse_ini_string($string);
        } catch (\Throwable $e) {
            preg_match('/on line (\d+)/', $e->getMessage(), $match);
            
            throw new \ErrorException(
                $e->getMessage(),
                $e->getCode(),
                E_ERROR,
                '',
                ($match[1] ?? 2) - 1,
                $e
            );
        }
    }
430344
static function parse_line($line)
    {
        $line = trim($line);
        $result = array();
        $datas = explode(self::$col_sep, $line);
        if (empty(self::$data_sep))
        {
            return $datas;
        }
        foreach ($datas as $data)
        {
            $d = self::parse_data($data);
            if (empty($d[0]))
            {
                continue;
            }
            $result[trim($d[0])] = trim($d[1]);
        }
        return $result;
    }
2717
public function parseString($string)
    {
        if (!mb_strlen($string)) {
            throw new \InvalidArgumentException('Option string must not be empty');
        }
        $options = array();
        $eol = mb_strlen($string) - 1;
        $nextCanBeColon = false;
        for ($i = 0; $i <= $eol; ++$i) {
            $ch = $string[$i];
            if (!preg_match('/^[A-Za-z0-9]$/', $ch)) {
                $colon = $nextCanBeColon ? " or ':'" : '';
                throw new \InvalidArgumentException("Option string is not well formed: "
                    ."expected a letter$colon, found '$ch' at position ".($i + 1));
            }
            if ($i == $eol || $string[$i + 1] != ':') {
                $options[] = new Option($ch, null, Getopt::NO_ARGUMENT);
                $nextCanBeColon = true;
            } elseif ($i < $eol - 1 && $string[$i + 2] == ':') {
                $options[] = new Option($ch, null, Getopt::OPTIONAL_ARGUMENT);
                $i += 2;
                $nextCanBeColon = false;
            } else {
                $options[] = new Option($ch, null, Getopt::REQUIRED_ARGUMENT);
                ++$i;
                $nextCanBeColon = true;
            }
        }
        return $options;
    }