protected function insertCaptureNames($name, $regexp)
	{
		$i = 0;

		return preg_replace_callback(
			'((?<!\\\\)\\((?!\\?))',
			function ($m) use (&$i, $name)
			{
				return '(?<' . $name . $i++ . '>';
			},
			$regexp
		);
	}
protected function insertCaptureNames($name, $regexp)
	{
		$i = 0;

		return preg_replace_callback(
			'((?<!\\\\)\\((?!\\?))',
			function ($m) use (&$i, $name)
			{
				return '(?<' . $name . $i++ . '>';
			},
			$regexp
		);
	}
protected function insertCaptureNames ( $ name , $ regexp ) { $ i = 0 ; return preg_replace_callback ( '((?<!\\\\)\\((?!\\?))' , function ( $ m ) use ( & $ i , $ name ) { return '(?<' . $ name . $ i ++ . '>' ; } , $ regexp ) ; }
Insert capture names into given regexp

@param  string $name   Name of the regexp, used to name captures
@param  string $regexp Original regexp
@return string         Modified regexp
Insert capture names into given regexp