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
# "Türkiye plaka kodu için regular expression Swift 4.2" | |
# "99 X 9999", "99 X 99999" | |
# "99 XX 999", "99 XX 9999" | |
# "99 XXX 99", "99 XXX 999" | |
# "boşluk karakterleri silme" | |
let plate = self.plateStr.replacingOccurrences(of: " ", with: "").localizedUppercase | |
public static func isValidPlate(candidate: String) -> Bool { | |
let pattern = "(0[1-9]|[1-7][0-9]|8[01])(([A-Z])(\\d{4,5})|([A-Z]{2})(\\d{3,4})|([A-Z]{3})(\\d{2,3}))" |