public function replace($regexp, $template, $tagName = null)
	{
		if (!isset($tagName))
		{
			$tagName = 'PREG_' . strtoupper(dechex(crc32($regexp)));
		}
		$this->parseRegexp($regexp);
		$this->parseTemplate($template);

		$passthroughIdx = $this->getPassthroughCapture();
		if ($passthroughIdx)
		{
			$this->captures[$passthroughIdx]['passthrough'] = true;
		}

		$regexp   = $this->fixUnnamedCaptures($regexp);
		$template = $this->convertTemplate($template, $passthroughIdx);

		$this->collection[] = [$tagName, $regexp, $passthroughIdx];

		return $this->createTag($tagName, $template);
	}