public static function validate($input, $separator = self::SEPARATOR_BOTH){

        $pattern = addcslashes(self::ALLOWED_CHARS . $separator, "[].-_/\\");
        $invalid = preg_match("/[^".$pattern."]+/", $input);

        return $invalid ? false : true;
    }