* @copyright 1997-2005 The PHP Group * @license http://www.gnu.org/copyleft/lesser.html LGPL * @version CVS: $Id: Ereg.php,v 1.5 2005/04/21 10:01:46 vincentlascaux Exp $ * @link http://pear.php.net/package/File_Archive */ require_once "File/Archive/Predicate.php"; /** * Keep only the files which name follow a given regular expression * * @see File_Archive_Predicate, File_Archive_Reader_Filter ereg */ class File_Archive_Predicate_Ereg extends File_Archive_Predicate { var $ereg; /** * @param string $ereg is the regular expression */ function File_Archive_Predicate_Ereg($ereg) { $this->ereg = $ereg; } /** * @see File_Archive_Predicate::isTrue() */ function isTrue(&$source) { return ereg($this->ereg, $source->getFilename()); } } ?>