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 of help.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
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.
Try this one
Note that none of other answers available so far doesn't verify PAN check digit.
Here is Luhn algorythm from http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#Java:
Regular Exp of PANCARD- '/[A-Z]{5}\d{4}[A-Z]{1}/i';
use the following if you use angular js
Controller
HTML
Very simple using simple concept.
Use this unique pancard no for testing purpose .
You can use Key press Event for PAN Card Validation in C#
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)