From 419f0815c85a40639ac82c1ce05c80186a64dc55 Mon Sep 17 00:00:00 2001 From: wei <> Date: Tue, 1 May 2007 03:19:30 +0000 Subject: remove identity map in active record. --- .../UI/WebControls/TRegularExpressionValidator.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/framework/Web/UI/WebControls/TRegularExpressionValidator.php index c4f7ceac..2f65d6b6 100644 --- a/framework/Web/UI/WebControls/TRegularExpressionValidator.php +++ b/framework/Web/UI/WebControls/TRegularExpressionValidator.php @@ -87,11 +87,31 @@ class TRegularExpressionValidator extends TBaseValidator if(($value=$this->getValidationValue($this->getValidationTarget()))==='') return true; if(($expression=$this->getRegularExpression())!=='') - return preg_match("/^$expression\$/",$value); + { + $mods = $this->getPatternModifiers(); + return preg_match("/^$expression\$/{$mods}",$value); + } else return true; } + /** + * @param string pattern modifiers, + * see http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php + */ + public function setPatternModifiers($value) + { + $this->setViewState('PatternModifiers', $value); + } + + /** + * @return string pattern modifiers, no modifiers by default. + */ + public function getPatternModifiers() + { + return $this->getViewState('PatternModifiers', ''); + } + /** * Returns an array of javascript validator options. * @return array javascript validator options. -- cgit v1.2.3