In this short bit, we want to decide whether a string is a phone number or an email address and create a value from this enum based on a string. We further created the two regexes to detect the different types - they may not be perfect, but this isn't the focus of this bit.
enum ContactPoint {
case phoneNumber(String)
case emailAddress(local: String, domain: String)