protected static function addNamedCaptures(array &$attributes, $string, array $regexps)
	{
		$matched = 0;
		foreach ($regexps as list($regexp, $map))
		{
			$matched += preg_match($regexp, $string, $m);
			foreach ($map as $i => $name)
			{
				if (isset($m[$i]) && $m[$i] !== '' && $name !== '')
				{
					$attributes[$name] = $m[$i];
				}
			}
		}

		return (bool) $matched;
	}
protected static function addNamedCaptures(array &$attributes, $string, array $regexps)
	{
		$matched = 0;
		foreach ($regexps as list($regexp, $map))
		{
			$matched += preg_match($regexp, $string, $m);
			foreach ($map as $i => $name)
			{
				if (isset($m[$i]) && $m[$i] !== '' && $name !== '')
				{
					$attributes[$name] = $m[$i];
				}
			}
		}

		return (bool) $matched;
	}
protected static function addNamedCaptures ( array & $ attributes , $ string , array $ regexps ) { $ matched = 0 ; foreach ( $ regexps as list ( $ regexp , $ map ) ) { $ matched += preg_match ( $ regexp , $ string , $ m ) ; foreach ( $ map as $ i => $ name ) { if ( isset ( $ m [ $ i ] ) && $ m [ $ i ] !== '' && $ name !== '' ) { $ attributes [ $ name ] = $ m [ $ i ] ; } } } return ( bool ) $ matched ; }
Add named captures from a set of regular expressions to a set of attributes

@param  array   &$attributes Associative array of strings
@param  string   $string     Text to match
@param  array[]  $regexps    List of [regexp, map] pairs
@return bool                 Whether any regexp matched
Add named captures from a set of regular expressions to a set of attributes