标签:reg hone format class obj cat UNC regex gen
//获取Image func FImage(_ imageName:String) -> UIImage { return UIImage(named:imageName)! } //获取Url func FUrl(_ urlString: String) -> URL? { return URL(string: urlString) } //验证是手机号的格式 func isPhone(phone: String) -> Bool{ let regex = "^1[3|4|5|7|8][0-9]\\d{8}$" let predicate = NSPredicate(format: "SELF MATCHES %@", regex) return predicate.evaluate(with: phone) }
标签:reg hone format class obj cat UNC regex gen
原文地址:https://www.cnblogs.com/kimiyo/p/9486114.html