EmailValidator
public class EmailValidator
A class to that the SDK uses to check for valid emails
-
An email validation string that is retrieved from the DexCare backend after initializing the SDK. The backend services all use this shared regex from config for email validation. Failing to validate with this regex string will result in 400 errors from the services.
Until the configuration is successfully retrieved it uses a hardcode value of
[A-Z0-9a-z._%+-]+@[A-Za-z0-9.]+\\.[A-Za-z]{2,64}
Declaration
Swift
public internal(set) static var emailValidationRegex: String { get }
-
A class function that tests whether or not a email is valid. Emails with dashes in the domain are not accepted.
Note
This is a simple regex test using the emailValidationRegex value. A convenience String method .isValidEmail() is also availableDeclaration
Swift
public static func isValid(email: String) -> Bool