public function evaluate($input = null)
{
// Set the input, if passed
if (null !== $input) {
$this->input = $input;
}
// Set the default message
if (null === $this->defaultMessage) {
if ($this->condition) {
$this->defaultMessage = I18n::factory()->__('The value format is not correct.');
} else {
$this->defaultMessage = I18n::factory()->__('The value format is not correct.');
}
}
// Evaluate the input against the validator
if (preg_match($this->value, $this->input) == $this->condition) {
$this->result = true;
} else {
$this->result = false;
}
return $this->result;
}