public function getNamedCaptures()
	{
		$captures   = [];
		$regexpInfo = RegexpParser::parse($this->regexp);

		// Prepare the start/end of the regexp and ensure that we use the D modifier
		$start = $regexpInfo['delimiter'] . '^';
		$end   = '$' . $regexpInfo['delimiter'] . $regexpInfo['modifiers'];
		if (strpos($regexpInfo['modifiers'], 'D') === false)
		{
			$end .= 'D';
		}

		foreach ($this->getNamedCapturesExpressions($regexpInfo['tokens']) as $name => $expr)
		{
			$captures[$name] = $start . $expr . $end;
		}

		return $captures;
	}
public function getNamedCaptures()
	{
		$captures   = [];
		$regexpInfo = RegexpParser::parse($this->regexp);

		// Prepare the start/end of the regexp and ensure that we use the D modifier
		$start = $regexpInfo['delimiter'] . '^';
		$end   = '$' . $regexpInfo['delimiter'] . $regexpInfo['modifiers'];
		if (strpos($regexpInfo['modifiers'], 'D') === false)
		{
			$end .= 'D';
		}

		foreach ($this->getNamedCapturesExpressions($regexpInfo['tokens']) as $name => $expr)
		{
			$captures[$name] = $start . $expr . $end;
		}

		return $captures;
	}
public function getNamedCaptures ( ) { $ captures = [ ] ; $ regexpInfo = RegexpParser :: parse ( $ this -> regexp ) ; // Prepare the start/end of the regexp and ensure that we use the D modifier $ start = $ regexpInfo [ 'delimiter' ] . '^' ; $ end = '$' . $ regexpInfo [ 'delimiter' ] . $ regexpInfo [ 'modifiers' ] ; if ( strpos ( $ regexpInfo [ 'modifiers' ] , 'D' ) === false ) { $ end .= 'D' ; } foreach ( $ this -> getNamedCapturesExpressions ( $ regexpInfo [ 'tokens' ] ) as $ name => $ expr ) { $ captures [ $ name ] = $ start . $ expr . $ end ; } return $ captures ; }
Return all the named captures with a standalone regexp that matches them

@return array Array of [capture name => regexp]
Return all the named captures with a standalone regexp that matches them