original_string: function validate($value, $regex = null)
      {
          if (isset($this->_data[$this->name])) {
              if (!preg_match($this->_data[$this->name], $value)) {
                  return false;
              }
          } else {
              if (!preg_match($regex, $value)) {
                  return false;
              }
          }
          return true;
      }
code: function validate($value, $regex = null)
      {
          if (isset($this->_data[$this->name])) {
              if (!preg_match($this->_data[$this->name], $value)) {
                  return false;
              }
          } else {
              if (!preg_match($regex, $value)) {
                  return false;
              }
          }
          return true;
      }
code_tokens: function validate ( $ value , $ regex = null ) { if ( isset ( $ this -> _data [ $ this -> name ] ) ) { if ( ! preg_match ( $ this -> _data [ $ this -> name ] , $ value ) ) { return false ; } } else { if ( ! preg_match ( $ regex , $ value ) ) { return false ; } } return true ; }
docstring: Validates a value using a regular expression
  
  @param     string    $value      Value to be checked
  @param     string    $regex      Regular expression
  @access    public
  @return    boolean   true if value is valid
docstring_tokens: Validates a value using a regular expression