Static Propertyvapor 4.114.1Vapor
Validates whether a String
is a valid email address.
static var email: Validator<T> { get }
Validates whether a String
is a valid email address.
static var email: Validator<T> { get }
where T == String
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
struct Validator<T> where T : Decodable, T : Sendable
@frozen struct String
A Unicode string value that is a collection of characters.
static var alphanumeric: Validator { get }
Validates that all characters in a String
are alphanumeric (a-z,A-Z,0-9).
static var ascii: Validator { get }
Validates that all characters in a String
are ASCII (bytes 0..<128).
static var internationalEmail: Validator<T> { get }
static var url: Validator<T> { get }
Validates whether a String
is a valid URL.
static func characterSet(_ characterSet: Foundation.CharacterSet) -> Validator
Validates that all characters in a String
are in the supplied CharacterSet
.
static func pattern(_ pattern: String) -> Validator<T>
Validates whether a String
matches a RegularExpression pattern