Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check the validation of edit text for pan card in objective c?

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.

like image 270
iPC Avatar asked Dec 05 '22 21:12

iPC


1 Answers

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)
    }
like image 126
Sunil aruru Avatar answered Mar 23 '23 01:03

Sunil aruru