How to verify PAN card?

前端 未结 15 1404
予麋鹿
予麋鹿 2021-02-13 11:46

How to check the validation of edittext for pan card like \"ABCDE1234F\". I am confused how to check the the validation for this. Please help me guys. I will appreciate any kind

15条回答
  •  星月不相逢
    2021-02-13 12:29

    Validating proper format should be done by this regex:

    /^[A-Z]{3}[ABCFGHLJPT][A-Z][0-9]{4}[A-Z]$/

    The difference from other answers is that this one takes into account that fourth letter can only take certain values. The whole regex can easily be changed to be case insensitive.

    On the other hand this check is too generic and a proper validation formula for the last check letter would be much better than only checking which position has a digit or letter. Alas this formula seems not to be public.

提交回复
热议问题