I have to validate the test is a valid pan card with help of some regular expression in iOS app development .can any one help this out.
PAN card validation for swift 4.0
func validatePANCardNumber(_ strPANNumber : String) -> Bool{
let regularExpression = "[A-Z]{5}[0-9]{4}[A-Z]{1}"
let panCardValidation = NSPredicate(format : "SELF MATCHES %@", regularExpression)
return panCardValidation.evaluate(with: strPANNumber)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With