This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| public func LOG(_ functionName: String, _ lineNumber: Int, _ items: Any) { | |
| #if DEBUG | |
| print("--> [\(functionName)][\(lineNumber)][\(Date())]: \(items)") | |
| #endif | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| func regex(input: String, rule: String) -> Bool { | |
| return NSPredicate(format:"SELF MATCHES %@", rule).evaluate(with: input) | |
| } | |
| let ruleString = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,64}" | |
| let inputString = "A0z._%+-@Ab1.-.Ab" | |
| let regexBool = regex(input: inputString, rule: ruleString) |