Exemple #1
0
 /**
  * @return string
  *
  * @throws BuildException
  */
 protected function doSelect()
 {
     $this->reg->setPattern($this->pattern);
     $this->reg->setModifiers($this->modifiers);
     $this->reg->setIgnoreCase(!$this->caseSensitive);
     $output = $this->defaultValue;
     try {
         if ($this->reg->matches($this->subject)) {
             $output = $this->reg->getGroup((int) ltrim($this->match, '$'));
         }
     } catch (Exception $e) {
         throw new BuildException($e);
     }
     return $output;
 }
 /**
  * Gets the matched group from the Regexp engine.
  *
  * @param array $matches Matched elements.
  *
  * @return string
  */
 private function replaceReferencesCallback($matches)
 {
     return (string) $this->reg->getGroup($matches[1]);
 }