protected static function getNamedCaptures($str, $regexp, $map)
	{
		if (!preg_match($regexp, $str, $m))
		{
			return [];
		}

		$values = [];
		foreach ($map as $i => $k)
		{
			if (isset($m[$i]) && $m[$i] !== '')
			{
				$values[$k] = $m[$i];
			}
		}

		return $values;
	}
protected static function getNamedCaptures($str, $regexp, $map)
	{
		if (!preg_match($regexp, $str, $m))
		{
			return [];
		}

		$values = [];
		foreach ($map as $i => $k)
		{
			if (isset($m[$i]) && $m[$i] !== '')
			{
				$values[$k] = $m[$i];
			}
		}

		return $values;
	}
protected static function getNamedCaptures ( $ str , $ regexp , $ map ) { if ( ! preg_match ( $ regexp , $ str , $ m ) ) { return [ ] ; } $ values = [ ] ; foreach ( $ map as $ i => $ k ) { if ( isset ( $ m [ $ i ] ) && $ m [ $ i ] !== '' ) { $ values [ $ k ] = $ m [ $ i ] ; } } return $ values ; }
Execute a regexp and return the values of the mapped captures

@param  string   $str
@param  string   $regexp
@param  string[] $map
@return array
Execute a regexp and return the values of the mapped captures