00001 <?php 00002 00015 // $Id: FormValidatorRegExp.inc.php,v 1.10 2008/07/01 01:16:09 asmecher Exp $ 00016 00017 00018 import ('form.validation.FormValidator'); 00019 00020 class FormValidatorRegExp extends FormValidator { 00021 00023 var $regExp; 00024 00030 function FormValidatorRegExp(&$form, $field, $type, $message, $regExp) { 00031 parent::FormValidator($form, $field, $type, $message); 00032 $this->regExp = $regExp; 00033 } 00034 00040 function isValid() { 00041 return $this->isEmptyAndOptional() || String::regexp_match($this->regExp, $this->form->getData($this->field)); 00042 } 00043 00044 } 00045 00046 ?>
1.5.6