Example #1
0
 /**
  * Returns value if it matches $pattern, FALSE otherwise. Uses
  * preg_match() for the matching.
  *
  * @param mixed $key
  * @param mixed $pattern
  * @return mixed
  */
 public function isRegex($key, $pattern = NULL)
 {
     return Zend_Filter::isRegex($this->_source[$key], $pattern);
 }
Example #2
0
 /**
  * Returns value if it matches $pattern, FALSE otherwise. Uses
  * preg_match() for the matching.
  *
  * @param mixed $key
  * @param mixed $pattern
  * @return mixed
  */
 public function testRegex($key, $pattern = NULL)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Zend_Filter::isRegex($this->_source[$key], $pattern)) {
         return $this->_source[$key];
     }
     return FALSE;
 }
Example #3
0
 /**
  * Returns value if it matches $pattern, FALSE otherwise. Uses
  * preg_match() for the matching.
  *
  * @param mixed $key
  * @param mixed $pattern
  * @return mixed
  */
 public function testRegex($key = null, $pattern = NULL)
 {
     if (!($value = $this->keyExists($key))) {
         return false;
     }
     if (Zend_Filter::isRegex($value, $pattern)) {
         return $value;
     }
     return FALSE;
 }