SPL-StandardPHPLibrary
keyfilter.inc
Go to the documentation of this file.
1 <?php
2 
23 {
25  private $regex;
26 
36  {
37  parent::__construct($it);
38  $this->regex = $regex;
39  }
40 
43  function accept()
44  {
45  return ereg($this->regex, $this->getInnerIterator()->key());
46  }
47 
50  function getRegex()
51  {
52  return $this->regex;
53  }
54 
58  protected function __clone()
59  {
60  // disallow clone
61  }
62 }
63 
64 ?>
__clone()
hidden __clone
Definition: keyfilter.inc:58
__construct(Iterator $it, $regex)
Constructs a filter around an iterator whose elemnts are strings.
Definition: keyfilter.inc:35
Abstract filter for iterators.
Basic iterator.
Definition: spl.php:549
Regular expression filter for string iterators.
Definition: keyfilter.inc:22