I'm trying to make a regular expression that looks for an e-mail. Everything works . How to get a Bool
variable that would mean whether such an expression was found or not?
let someString = "123milka@yandex.ru123"
let regexp = "([a-zA-Z]{1,20})@([a-zA-Z]{1,20}).(com|ru|org)"
if let range = someString.range(of: regexp, options: .regularExpression) {
let result : String = someString.substring(with: range)
print(result)
}