/** * 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); }
/** * 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; }
/** * 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; }