summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TRegularExpressionValidator.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/UI/WebControls/TRegularExpressionValidator.php')
-rw-r--r--framework/Web/UI/WebControls/TRegularExpressionValidator.php22
1 files changed, 21 insertions, 1 deletions
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,12 +87,32 @@ 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.
*/