protected function compile()
	{
		if ($this->compiled !== false)
		{
			return $this->compiled;
		}

		if ($this->isStatic())
		{
			$this->compiled = '~^'.$this->pattern.'$~';
			return $this->compiled;
		}

		$compiled = $this->pattern;
		foreach ($this->getSegments($compiled) as $segment)
		{
			$compiled = \str_replace($segment['token'], $segment['regex'], $compiled);
		}

		$this->compiled = "~^{$compiled}$~";
		return $this->compiled;
	}
protected function compile()
	{
		if ($this->compiled !== false)
		{
			return $this->compiled;
		}

		if ($this->isStatic())
		{
			$this->compiled = '~^'.$this->pattern.'$~';
			return $this->compiled;
		}

		$compiled = $this->pattern;
		foreach ($this->getSegments($compiled) as $segment)
		{
			$compiled = \str_replace($segment['token'], $segment['regex'], $compiled);
		}

		$this->compiled = "~^{$compiled}$~";
		return $this->compiled;
	}
protected function compile ( ) { if ( $ this -> compiled !== false ) { return $ this -> compiled ; } if ( $ this -> isStatic ( ) ) { $ this -> compiled = '~^' . $ this -> pattern . '$~' ; return $ this -> compiled ; } $ compiled = $ this -> pattern ; foreach ( $ this -> getSegments ( $ compiled ) as $ segment ) { $ compiled = \ str_replace ( $ segment [ 'token' ] , $ segment [ 'regex' ] , $ compiled ) ; } $ this -> compiled = "~^{$compiled}$~" ; return $ this -> compiled ; }
Compiles the pattern into one suitable for regex.

@return string   The regex pattern
Compiles the pattern into one suitable for regex .