protected function saveRegex()
	{
		echo $this->a . $this->b;

		while (($this->a = $this->getChar()) !== false)
		{
			if ($this->a === '/')
			{
				break;
			}

			if ($this->a === '\\')
			{
				echo $this->a;
				$this->a = $this->getChar();
			}

			if ($this->a === "\n")
			{
				throw new \RuntimeException('Unclosed regex pattern at position: ' . $this->index);
			}

			echo $this->a;
		}

		$this->b = $this->getReal();
	}
protected function saveRegex()
	{
		echo $this->a . $this->b;

		while (($this->a = $this->getChar()) !== false)
		{
			if ($this->a === '/')
			{
				break;
			}

			if ($this->a === '\\')
			{
				echo $this->a;
				$this->a = $this->getChar();
			}

			if ($this->a === "\n")
			{
				throw new \RuntimeException('Unclosed regex pattern at position: ' . $this->index);
			}

			echo $this->a;
		}

		$this->b = $this->getReal();
	}
protected function saveRegex ( ) { echo $ this -> a . $ this -> b ; while ( ( $ this -> a = $ this -> getChar ( ) ) !== false ) { if ( $ this -> a === '/' ) { break ; } if ( $ this -> a === '\\' ) { echo $ this -> a ; $ this -> a = $ this -> getChar ( ) ; } if ( $ this -> a === "\n" ) { throw new \ RuntimeException ( 'Unclosed regex pattern at position: ' . $ this -> index ) ; } echo $ this -> a ; } $ this -> b = $ this -> getReal ( ) ; }
When a regular expression is detected this function crawls for the end of
it and saves the whole regex.

@throws \RuntimeException Unclosed regex will throw an error
When a regular expression is detected this function crawls for the end of it and saves the whole regex .