Parse the variable identifier

@param   string  Variable identifier
@return  array   0 => hash, 1 => parts
962793
protected static function _parseIdentifier($identifier)
    {
        $parts = array();
        $hash  = $identifier;

        // Validate the variable format
        if (strpos($identifier, '.') !== false) {
            // Split the variable name into it's parts
            $parts = explode('.', $identifier);

            // Validate the hash name
            $hash   = array_shift($parts);
        }

        $hash = strtoupper($hash);

        return array($hash, $parts);
    }
631804
public static function parse($string)
  {
    $attr = [];
    $list = [];

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

    if ( is_array($attr) ){
      $numPairs = count($attr[1]);
      for ($i = 0; $i < $numPairs; $i++){
        $list[$attr[1][$i]] = $attr[2][$i];
      }
    }
    
    return $list;
  }
901207
function parseVariableDeclarations(string, syntax, options) {
  string = ignoreBlock.removeIgnoredBlocks(string);
  var parser = getParserForSyntax(syntax, options);
  if (parser) {
    return parser.parseVariableDeclarations(string);
  }
  return [];
}
1079366
private function _parse_variable_to()
    {
        $parts = explode('#', $this->_to);
        empty($parts[1]) && $parts[1] = 'index';
        
        $part = is_int(strpos($parts[0], ':')) ? $parts[0] : $parts[1];
        
        preg_match('/:(\w+)/', $part, $m);
        $type = $m[1];
        
        return $type;
    }
902077
private function extractVariablePart($name)
    {
        return StringHelper::substring($name, $this->prefixLength, strlen($name) - $this->postfixLength - 1);
    }
289606
public function parseIdentifier(ObjectIdentifier $identifier)
    {
        $info = parent::parseIdentifier($identifier);

        $path  = $identifier->path;

        //Allow locating default classes if $path is empty.
        if(empty($path))
        {
            $info['path']    = $info['file'];
            $info['file']    = '';
            $info['package'] = '';
        }
        else
        {
            $package = array_shift($path);

            $info['path']    = StringInflector::implode($path);
            $info['package'] = ucfirst($package);
        }

        //Make an exception for 'view' and 'module' types
        if(in_array($info['package'], array('View','Module')) && !in_array('behavior', $path)) {
            $info['path'] = '';
        }

        return $info;
    }
1141700
private function parseVariable(&$parts) {
		// if the next item starts with a $ or ...$ it must be the variable name
		if (isset($parts[0])
				&& (strlen($parts[0]) > 0)
				&& ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$')) {
			$this->variable = array_shift($parts);
			array_shift($parts);

			if (substr($this->variable, 0, 3) === '...') {
				$this->isVariadic = true;
				$this->variable = substr($this->variable, 3);
			}
		}
	}
12309
public static function getVariableValues(Variable $variable) {

        $returnValue = array();

        $baseType = $variable->getBaseType();
        $cardinalityType = $variable->getCardinality();
        $value = $variable->getValue();
        
        // This only works if the variable has a value ;)
        if ($value !== null) {
            
            if ($baseType === BaseType::IDENTIFIER) {
            
                if ($cardinalityType === Cardinality::SINGLE) {
            
                    $returnValue[] = $value->getValue();
                }
                else if($cardinalityType === Cardinality::MULTIPLE) {
            
                    foreach($variable->getValue() as $value) {
            
                        $returnValue[] = $value->getValue();
                    }
                }
            }
        }

        return $returnValue;
    }
260126
function _generate_identifier()
    {
        $identifier = 'SSH-2.0-phpseclib_2.0';

        $ext = array();
        if (function_exists('\\Sodium\\library_version_major')) {
            $ext[] = 'libsodium';
        }

        if (extension_loaded('openssl')) {
            $ext[] = 'openssl';
        } elseif (extension_loaded('mcrypt')) {
            $ext[] = 'mcrypt';
        }

        if (extension_loaded('gmp')) {
            $ext[] = 'gmp';
        } elseif (extension_loaded('bcmath')) {
            $ext[] = 'bcmath';
        }

        if (!empty($ext)) {
            $identifier .= ' (' . implode(', ', $ext) . ')';
        }

        return $identifier;
    }
274080
public String parseVariableName() {
    	if(asString == null)
    		return null;
    	
    	String var = asString.trim();
    	if(!var.startsWith("$"))
    		throw new IllegalStateException("This expression is not a variable reference");
    	
    	Scanner scanner = new Scanner(var.substring(1));
    	scanner.findInLine("\\{\\s*(\\w+)\\s*\\}");
    	MatchResult matchResults = scanner.match();
    	if(matchResults.groupCount() != 1)
    		throw new IllegalStateException("Malformed variable name expression.");
    		
		return matchResults.group(1);
	}
360573
function parseVariableIdentifier() {
        var token = lex();

        if (token.type !== Token.Identifier) {
            throwUnexpected(token);
        }

        return {
            type: Syntax.Identifier,
            name: token.value
        };
    }
844191
protected function parseManagerId($string)
    {
        list($appId, $workerClass, $managerId) = explode('@', $string);

        return [
            Manager::P_APP_ID       => $appId,
            Manager::P_WORKER_CLASS => $workerClass,
            Manager::P_ID           => $managerId,
        ];
    }
285282
function quoteIdentifier( $identifier ) {

        $delimiter = $this->identifierDelimiter;

        if ( empty( $delimiter ) ) return $identifier;

        $identifier = explode( ".", $identifier );

        $identifier = array_map(
            function( $part ) use ( $delimiter ) { return $delimiter . str_replace( $delimiter, $delimiter.$delimiter, $part ) . $delimiter; },
            $identifier
        );

        return implode( ".", $identifier );

    }
201631
protected function parse_vars($string)
	{
		foreach ($this->vars as $var => $val)
		{
			$string = str_replace("%$var%", $val, $string);
		}

		return $string;
	}
155971
protected function _parseVar() {
        $this->_content = preg_replace('`' . preg_quote($this->markup['vars'][0]) . $this->_space . '([\\\[\]\(\)A-Za-z0-9\$\'"_\>\+\-]+)' . $this->_space . preg_quote($this->markup['vars'][1]) . '`ism', '<?php echo ($1); ?>', $this->_content);
    }
185631
public static function convertVariableToString($variable) {
		$string = '';
		if (is_array($variable)) {
			$string = self::viewArray($variable);
		} elseif (is_object($variable)) {
			$string = '<strong>|Object:<pre>';
			$string .= print_r($variable, TRUE);
			$string .= '</pre>|</strong>';
		} elseif ((string) $variable !== '') {
			$string = '<strong>|' . htmlspecialchars((string) $variable) . '|</strong>';
		} else {
			$string = '<strong>| debug |</strong>';
		}

		return $string;
	}
38829
def extract_variables_from_string(string)
      string.split(/ /).map do |defintion|
        match = defintion.match STRING_REG_EX
        next nil unless match

        { match[1] => match[2] }
      end.reject(&:nil?)
    end