More than 1 year has passed since last update.

その文字列がメールアドレスか調べる関数

    /// その文字列がメールアドレスかどうか調べる
    class func isValidEmail(string: String) -> Bool {
        println("validate calendar: \(string)")
        let emailRegEx = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
        var emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx)
        let result = emailTest?.evaluateWithObject(string)
        return result!
    }

٩(๑❛ᴗ❛๑)۶