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);
    }
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);
    }
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 ) ; }
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
Used when a custom regular expression is needed .