Inflearn Community Q&A
정규 표현식 오류
Written on
·
262
0

오류의 이유를 알 수 있을까요~?
swiftios
Answer 1
1
KxCoding
Instructor
안녕하세요 :)
== 연산자가 타입이 다른 두 튜플을 비교하지 못하기 때문에 발생하는 오류입니다.
강의와 동일한 코드를 입력하시면 정상적으로 실행됩니다.
if let result = emailAddress.range(of: emailPattern, options: [.regularExpression]), (result.lowerBound, result.upperBound) == (emailAddress.startIndex, emailAddress.endIndex) {
print("valid email")
} else {
print("invalid email")
}





