public static function getCaptureNames($regexp)
	{
		$map        = [''];
		$regexpInfo = self::parse($regexp);
		foreach ($regexpInfo['tokens'] as $tok)
		{
			if ($tok['type'] === 'capturingSubpatternStart')
			{
				$map[] = (isset($tok['name'])) ? $tok['name'] : '';
			}
		}

		return $map;
	}
public static function getCaptureNames($regexp)
	{
		$map        = [''];
		$regexpInfo = self::parse($regexp);
		foreach ($regexpInfo['tokens'] as $tok)
		{
			if ($tok['type'] === 'capturingSubpatternStart')
			{
				$map[] = (isset($tok['name'])) ? $tok['name'] : '';
			}
		}

		return $map;
	}
public static function getCaptureNames ( $ regexp ) { $ map = [ '' ] ; $ regexpInfo = self :: parse ( $ regexp ) ; foreach ( $ regexpInfo [ 'tokens' ] as $ tok ) { if ( $ tok [ 'type' ] === 'capturingSubpatternStart' ) { $ map [ ] = ( isset ( $ tok [ 'name' ] ) ) ? $ tok [ 'name' ] : '' ; } } return $ map ; }
Return the name of each capture in given regexp

Will return an empty string for unnamed captures

@param  string   $regexp
@return string[]
Return the name of each capture in given regexp