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;
	}