EmailPatterns

public enum EmailPatterns

Regular expressions for matching e-mail addresses and their prefixes.

This enumeration has no cases and serves only as a namespace.

E-Mail Handling

  • A regular expression that matches well-formed e-mail addresses.

    Some malformed e-mail addresses may also match this expression. This regular expression is only an approximation intended to catch obvious formatting errors. It accepts only ASCII characters and does not process Punycode.

    This regular expression can safely cross isolation boundaries because it has no matching closures that could capture mutable state.

    Declaration

    Swift

    public nonisolated(unsafe) static let address: Regex<Substring>
  • A regular expression that matches prefixes of well-formed e-mail addresses.

    Here, well-formed means matching the address regular expression.

    This regular expression can safely cross isolation boundaries because it has no matching closures that could capture mutable state.

    Declaration

    Swift

    public nonisolated(unsafe) static let addressPrefix: Regex<Substring>