Swiftpack.co - Package - bdolewski/SwiftEmailValidator


Very small e-mail validation helper written in Swift. It contains regular expresion that is compliant with RFC 5322. You can use it via Swift Package Manager or just copy file SwiftEmailValidator.swift into your project - done!

How do I use it in my code?

Simple as this:

let result = EmailValidator.isValid(email: "john.appleseed@apple.com")

There is only 1 static function isValid(email:) enclosed in namespace EmailValidator (just a case-less enum to not create any instances of EmailValidator)


Stars: 3


Used By

Total: 0


v1.2.1 - 2019-09-27 17:25:34

  • fixed issue with downloading package directly from Xcode 11

v1.2.0 - Improved "namespacing" - 2019-09-22 19:41:37

Now creating instances of EmailValidator is impossible by switching from struct to enum with no cases.

v1.1.0 - compliant with RFC 5322 - 2019-09-22 14:06:07

Updated regular expression to match official one from RFC 5322

v1.0.0 - compliant with RFC 2822 - 2019-09-20 19:10:43

Added validation for e-mail address compliant with RFC 2822. Added support for Swift Package Manager