public static function parseEqualityExpr($expr)
	{
		// Match an equality between a variable and a literal or the concatenation of strings
		$eq = '(?<equality>'
		    . '(?<key>@[-\\w]+|\\$\\w+|\\.)'
		    . '(?<operator>\\s*=\\s*)'
		    . '(?:'
		    . '(?<literal>(?<string>"[^"]*"|\'[^\']*\')|0|[1-9][0-9]*)'
		    . '|'
		    . '(?<concat>concat\\(\\s*(?&string)\\s*(?:,\\s*(?&string)\\s*)+\\))'
		    . ')'
		    . '|'
		    . '(?:(?<literal>(?&literal))|(?<concat>(?&concat)))(?&operator)(?<key>(?&key))'
		    . ')';

		// Match a string that is entirely composed of equality checks separated with "or"
		$regexp = '(^(?J)\\s*' . $eq . '\\s*(?:or\\s*(?&equality)\\s*)*$)';
		if (!preg_match($regexp, $expr))
		{
			return false;
		}

		preg_match_all("((?J)$eq)", $expr, $matches, PREG_SET_ORDER);

		$map = [];
		foreach ($matches as $m)
		{
			$key   = $m['key'];
			$value = (!empty($m['concat']))
			       ? self::evaluateConcat($m['concat'])
			       : self::evaluateLiteral($m['literal']);

			$map[$key][] = $value;
		}

		return $map;
	}
public static function parseEqualityExpr($expr)
	{
		// Match an equality between a variable and a literal or the concatenation of strings
		$eq = '(?<equality>'
		    . '(?<key>@[-\\w]+|\\$\\w+|\\.)'
		    . '(?<operator>\\s*=\\s*)'
		    . '(?:'
		    . '(?<literal>(?<string>"[^"]*"|\'[^\']*\')|0|[1-9][0-9]*)'
		    . '|'
		    . '(?<concat>concat\\(\\s*(?&string)\\s*(?:,\\s*(?&string)\\s*)+\\))'
		    . ')'
		    . '|'
		    . '(?:(?<literal>(?&literal))|(?<concat>(?&concat)))(?&operator)(?<key>(?&key))'
		    . ')';

		// Match a string that is entirely composed of equality checks separated with "or"
		$regexp = '(^(?J)\\s*' . $eq . '\\s*(?:or\\s*(?&equality)\\s*)*$)';
		if (!preg_match($regexp, $expr))
		{
			return false;
		}

		preg_match_all("((?J)$eq)", $expr, $matches, PREG_SET_ORDER);

		$map = [];
		foreach ($matches as $m)
		{
			$key   = $m['key'];
			$value = (!empty($m['concat']))
			       ? self::evaluateConcat($m['concat'])
			       : self::evaluateLiteral($m['literal']);

			$map[$key][] = $value;
		}

		return $map;
	}
public static function parseEqualityExpr ( $ expr ) { // Match an equality between a variable and a literal or the concatenation of strings $ eq = '(?<equality>' . '(?<key>@[-\\w]+|\\$\\w+|\\.)' . '(?<operator>\\s*=\\s*)' . '(?:' . '(?<literal>(?<string>"[^"]*"|\'[^\']*\')|0|[1-9][0-9]*)' . '|' . '(?<concat>concat\\(\\s*(?&string)\\s*(?:,\\s*(?&string)\\s*)+\\))' . ')' . '|' . '(?:(?<literal>(?&literal))|(?<concat>(?&concat)))(?&operator)(?<key>(?&key))' . ')' ; // Match a string that is entirely composed of equality checks separated with "or" $ regexp = '(^(?J)\\s*' . $ eq . '\\s*(?:or\\s*(?&equality)\\s*)*$)' ; if ( ! preg_match ( $ regexp , $ expr ) ) { return false ; } preg_match_all ( "((?J)$eq)" , $ expr , $ matches , PREG_SET_ORDER ) ; $ map = [ ] ; foreach ( $ matches as $ m ) { $ key = $ m [ 'key' ] ; $ value = ( ! empty ( $ m [ 'concat' ] ) ) ? self :: evaluateConcat ( $ m [ 'concat' ] ) : self :: evaluateLiteral ( $ m [ 'literal' ] ) ; $ map [ $ key ] [ ] = $ value ; } return $ map ; }
Parse an XPath expression that is composed entirely of equality tests between a variable part
and a constant part

@param  string      $expr
@return array|false
Parse an XPath expression that is composed entirely of equality tests between a variable part and a constant part