Skip to content

Commit

Permalink
[Add] 이메일 정규식 추가 #10
Browse files Browse the repository at this point in the history
  • Loading branch information
meltsplit committed Apr 27, 2023
1 parent 4f5cc4b commit c3a085f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions SOPTving/SOPTving/Utility/Extension/String+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// String+.swift
// SOPTving
//
// Created by 장석우 on 2023/04/28.
//

import Foundation

extension String {

var isEmailFormat: Bool {
let emailRegex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"
return NSPredicate(format: "SELF MATCHES %@", emailRegex).evaluate(with: self)
}
}

0 comments on commit c3a085f

Please sign in to comment.