original_string: public static function custom($check, $regex = null)
      {
          if ($regex === null) {
              static::$errors[] = 'You must define a regular expression for Validation::custom()';
  
              return false;
          }
  
          return static::_check($check, $regex);
      }
code: public static function custom($check, $regex = null)
      {
          if ($regex === null) {
              static::$errors[] = 'You must define a regular expression for Validation::custom()';
  
              return false;
          }
  
          return static::_check($check, $regex);
      }
code_tokens: public static function custom ( $ check , $ regex = null ) { if ( $ regex === null ) { static :: $ errors [ ] = 'You must define a regular expression for Validation::custom()' ; return false ; } return static :: _check ( $ check , $ regex ) ; }
docstring: Used when a custom regular expression is needed.
  
  @param string $check The value to check.
  @param string|null $regex If $check is passed as a string, $regex must also be set to valid regular expression
  @return bool Success
docstring_tokens: Used when a custom regular expression is needed .