setPattern() public method

public setPattern ( $pattern )
 /**
  * The heart of the matter. This is where the selector gets to decide
  * on the inclusion of a file in a particular fileset.
  *
  * @param PhingFile $basedir base directory the scan is being done from
  * @param string $filename the name of the file to check
  * @param PhingFile $file PhingFile object the selector can use
  *
  * @throws BuildException
  *
  * @return bool whether the file should be selected or not
  */
 public function isSelected(PhingFile $basedir, $filename, PhingFile $file)
 {
     $this->validate();
     if ($file->isDirectory()) {
         return true;
     }
     if ($this->myRegExp === null) {
         $this->myRegExp = new RegularExpression();
         $this->myRegExp->setPattern($this->userProvidedExpression);
         if (!$this->casesensitive) {
             $this->myRegExp->setIgnoreCase(true);
         }
         $this->myExpression = $this->myRegExp->getRegexp($this->getProject());
     }
     $in = null;
     try {
         $in = new BufferedReader(new FileReader($file));
         $teststr = $in->readLine();
         while ($teststr !== null) {
             if ($this->myExpression->matches($teststr)) {
                 return true;
             }
             $teststr = $in->readLine();
         }
         $in->close();
         return false;
     } catch (IOException $ioe) {
         if ($in) {
             $in->close();
         }
         throw new BuildException("Could not read file " . $filename);
     }
 }
 /**
  * Parses parameters to add user defined regular expressions.
  */
 private function _initialize()
 {
     $params = $this->getParameters();
     if ($params !== null) {
         for ($i = 0; $i < count($params); $i++) {
             if (self::REGEXP_KEY === $params[$i]->getType()) {
                 $pattern = $params[$i]->getValue();
                 $regexp = new RegularExpression();
                 $regexp->setPattern($pattern);
                 array_push($this->_regexps, $regexp);
             }
         }
     }
 }
 /**
  * Sets the regexp match pattern
  * 
  * @param string $regexp 
  */
 public function setMatch($regexp)
 {
     $this->_regexp->setPattern($regexp);
 }