[parse description]
@param  [type]  $text    [description]
@param  boolean $sandbox [description]
@return [type]           [description]
774803
public function parse($text, $sandbox=false, $srcinfo=null) {

        $this->srcinfo = $srcinfo;

        return $this->compile($text, $sandbox);
    }
1167740
static function matchText( &$text, $match_pre, $match_post )
    {
        $ret = null;
        if ( $match_pre !== '' )
        {
            $pos = strpos( $text, $match_pre );
            if ( $pos === false )
                return null;

            $ret = substr( $text, $pos + strlen( $match_pre ) );
            $text = substr( $text, 0, $pos );
        }
        if ( $match_post !== '' )
        {
            $pos = strpos( $ret, $match_post );
            if ( $pos === false )
                return null;

            $text .= substr( $ret, $pos + 1 );
            $ret = substr( $ret, 0, $pos );
        }
        return $ret;
    }
878727
public function isTextValid(string $text): bool
    {
        $parser = new Node_Container_Document();

        if ($this->configData['emoticons']['active']) {
            $parser->add_emoticons($this->configData['emoticons']['path']);
        }

        $this->errorText = '';
        $result = true;
        try {
            $parser->parse($text)
                ->detect_links()
                ->detect_emails();

            if ($this->configData['emoticons']['active']) {
                $parser->detect_emoticons();
            }

            $parser->get_html();

        } catch (\Exception $e) {
            $result = false;
            $this->errorText = $e->getMessage();
        } catch (\Throwable $e) {
            $result = false;
            $this->errorText = $e->getMessage();
        }

        return $result;
    }
72109
public function parse($text) {
        $parsedText = $this->parseGs1128($text);
        if($this->customLabelText!==false and CINBarcode1D::AUTO_LABEL!=$this->customLabelText){
            parent::setLabel($this->customLabelText);    
        }
        parent::parse($parsedText);
    }
843899
public function execute($content, $params = array(), $sandbox=false, $srcinfo=null) {

        $obj = $this;

        ob_start();

        lexy_eval_with_params($obj, $content, $params, $sandbox, $srcinfo);

        $output = ob_get_clean();

        return $output;
    }
222627
protected function parseSelector($text)
    {
        if (0 === strpos($text, 'id=')) {
            return By::id(substr($text, 3));
        }

        if (0 === strpos($text, 'xpath=')) {
            return By::xpath(substr($text, 6));
        }

        if (0 === strpos($text, 'css=')) {
            return By::css(substr($text, 4));
        }

        if (0 === strpos($text, 'name=')) {
            return By::name(substr($text, 5));
        }

        if (0 === strpos($text, 'class=')) {
            return By::className(substr($text, 6));
        }

        return $text;
    }
977451
public function parse($text)
    {
        $names = $this->names
            ? implode('|', array_map('preg_quote', $this->names))
            : RegexBuilderUtility::buildNameRegex();
        $regex = str_replace('<NAMES>', $names, static::$shortcodeRegex);
        preg_match_all($regex, $text, $matches, PREG_OFFSET_CAPTURE);

        $shortcodes = array();
        $count = count($matches[0]);
        for($i = 0; $i < $count; $i++) {
            $name = $matches[2][$i][0];
            $parameters = static::parseParameters($matches[3][$i][0]);
            $content = $matches[5][$i][1] !== -1 ? $matches[5][$i][0] : null;
            $match = $matches[0][$i][0];
            $offset = mb_strlen(substr($text, 0, $matches[0][$i][1]), 'utf-8');

            $shortcode = new Shortcode($name, $parameters, $content, null);
            $shortcodes[] = new ParsedShortcode($shortcode, $match, $offset);
        }

        return $shortcodes;
    }
625535
protected static function checkColons($text)
    {
        if (strpos($text, ':') !== false
        || strpos($text, '[') !== false
        || strpos($text, '{') !== false
        || strpos($text, '-') !== false
        || strpos($text, '<') !== false
        || strpos($text, '&') !== false
        ) {
            return '"'.str_replace('"', '\"', $text).'"';
        }

        return $text;
    }
1272664
public function parse(string $text) : string
    {
        if ($text === '')
            throw new ParseException($this, $text, 0, self::NO_EMPTY);
        return $text;
    }
1305050
public static function parseExternalLinks( $text ) {
		static $urlProtocols = false;
		static $counter = 0;
		// @codeCoverageIgnoreStart
		if ( !$urlProtocols ) {
			if ( function_exists( 'wfUrlProtocols' ) ) {
				// Allow custom protocols
				$urlProtocols = wfUrlProtocols();
			} else {
				$urlProtocols = 'https?:\/\/|ftp:\/\/';
			}
		}
		// @codeCoverageIgnoreEnd

		$extLinkBracketedRegex = '/(?:(<[^>]*)|' .
			'\[(((?i)' . $urlProtocols . ')' .
				self::EXT_LINK_URL_CLASS .
				'+)\p{Zs}*([^\]\\x00-\\x08\\x0a-\\x1F]*?)\]|' .
			'(((?i)' . $urlProtocols . ')' .
				self::EXT_LINK_URL_CLASS .
				'+))/Su';

		return preg_replace_callback(
			$extLinkBracketedRegex,
			function ( array $bits ) use ( &$counter ) {
				// @codeCoverageIgnoreStart
				if ( $bits[1] != '' ) {
					return $bits[1];
				}
				// @codeCoverageIgnoreEnd

				if ( isset( $bits[4] ) && $bits[4] != '' ) {
					return '<a href="' . $bits[2] . '">' . $bits[4] . '</a>';
				} elseif ( isset( $bits[5] ) ) {
					return '<a href="' . $bits[5] . '">' . $bits[5] . '</a>';
				} else {
					return '<a href="' . $bits[2] . '">[' . ++$counter . ']</a>';
				}
			},
			$text
		);
	}
265700
protected function parseTableStructure($text)
    {
        $dom = $this->createDocumentWithHtml($text);

        $tableNode = $dom->getElementsByTagName('table')->item(0);

        $table = new Table($tableNode);

        $this->parseTable($table);

        return $table;
    }
449875
public function parse(string $text) : string
    {
        $tokens = $this->tokenizer->tokenize($text);
        $segments = $this->createSegments($tokens);
        $nodes = $this->createTree($segments);
        return $this->generator->generateMarkup($nodes);
    }
263843
protected function _parseUrls($text, array $paths)
    {
        $matches = array();
        $replaces = array();

        $finder = $this->getService('anahita:file.pathfinder')
                ->addSearchDirs(array_reverse($paths));
        $starting_path = $paths[0];

        if (preg_match_all('/url\((.*?)\)/', $text, $matches)) {
            foreach ($matches[1] as $match) {
                $match = str_replace(array('"', "'"), '', $match);

                if ($path = $finder->getPath($match)) {
                    $path = AnHelperFile::getTravelPath($starting_path, $path);
                    $path = str_replace(DS, '/', $path);
                    $replaces[$match] = $path;
                }
            }
        }

        $text = str_replace(array_keys($replaces), array_values($replaces), $text);

        return $text;
    }
1357410
protected function parseStrong($text)
	{
		$pattern =<<< REGEXP
/^\*\*(
  (.*?{{{.*?}}}.*?)+?|  # including inline code span
  (?!.*{{{.*?}}}).*?    # without inline code span
)\*\*/sx
REGEXP;
		if (preg_match($pattern, $text, $matches)) {
			return [
				[
					'strong',
					$this->parseInline($matches[1])
				],
				strlen($matches[0])
			];
		} else {
			// no ending ** ... should be treated as strong
			return [
				[
					'strong',
					$this->parseInline(substr($text,2))
				],
				strlen($text)
			];
		}
	}
580921
public function parse(string $text) : bool
    {
        $lower = strtolower($text);
        if (! in_array($lower, array_merge(self::TRUE_VALUES, self::FALSE_VALUES)))
            throw new ParseException($this, $text, 0, self::PARSE_ERROR);
        return in_array($lower, self::TRUE_VALUES);
    }
711619
static function parse($text)
    {
        $parser = new \Parsedown();

        $text = static::cleanLeadingSpace($text);

        return $parser->text($text);
    }
781852
public static function Parse($text)
	{
		$text = strtoupper( trim( $text ) );

		$result = preg_match( "/^(?<sign>-?)(?<year>\d{4,4})-(?<month>\d{1,2})(?<offset>(?=[+\-a-zA-Z])(([+\-]\d{2}(:\d{2}))|Z|((\?!-|\\+)(?i)[^0-9].{3,})))?$/i", $text, $matches );
		if ( ! $result )
		{
			throw XPath2Exception::withErrorCodeAndParams( "FORG0001", Resources::FORG0001, array( $text, "xs:gYear" ) );
		}

		$error =	empty( $matches['year'] ) ||
					( CoreFuncs::$strictGregorian && $matches['year'] < 1532 ) ||
					empty( $matches['month'] ) ||
					$matches['month'] > 12 ||
					$matches['month'] < 1;

		$offsetMatches = null;
		if ( ! $error && ! empty( $matches['offset'] ) )
		{
			$error = $matches['offset'] != "Z" &&
			! in_array( $matches['offset'], timezone_identifiers_list() ) &&
			! preg_match( "/^[+-](?<hours>\d{2})(:(?<minutes>\d{2}))?$/", $matches['offset'], $offsetMatches );

			if ( ! $error && ! is_null( $offsetMatches ) )
			{
				$error = empty( $offsetMatches['hours'] ) || $offsetMatches['hours'] > 14 ||
						 empty( $offsetMatches['minutes'] ) || $offsetMatches['minutes'] > 59;
			}

		}

		if ( $error )
		{
			throw XPath2Exception::withErrorCodeAndParams( "FORG0001", Resources::FORG0001, array( $text, "xs:gYearMonth" ) );
		}

		/**
		 * @var bool $s
		 */
	    $s = SchemaTypes::startsWith( $text, "-" );
		if ( $s ) $text = substr( $text, 1 );
		$dateTime = \DateTime::createFromFormat( "!Y-mO", $text );
		if ( $dateTime )
	        return new GYearMonthValue( $s, $dateTime );

		$dateTime = \DateTime::createFromFormat( "!Y-m\Z", $text );
		if ( $dateTime )
	        return new GYearMonthValue( $s, $dateTime );

		$dateTime = \DateTime::createFromFormat( "!Y-m", $text );
		if ( $dateTime )
	        return new GYearMonthValue( $s, $dateTime );

        throw XPath2Exception::withErrorCodeAndParams( "FORG0001", Resources::FORG0001, array( $text, "GYearMonth" ) );
	}