This is the ideal PAN RegEx number::
String panNumber = "AAAPL1234C"; // get your editext value here Pattern pattern = Pattern.compile("[AZ]{3}[ABCFGHLJPTF]{1}[AZ]{1}[0-9]{4}[AZ]{1}"); Matcher matcher = pattern.matcher(panNumber ); // Check if pattern matches if (matcher.matches()) { Log.i("Matching","Yes"); }
There are several conditions for a PAN number :
A PAN (or PAN number) is an alphanumeric unique identifier ten characters long.
The PAN structure is as follows: AAAPL1234C :
The first five characters are letters (upper case by default) followed by four digits, and the last (tenth) character is a letter. The first three characters of the code are three letters forming a sequence of letters of the alphabet from AAA to ZZZ
the fourth character indicates the type of card holder. Each type of holder is uniquely identified by the letter from the list below:
- A - Association of Persons (AOP)
- B - Face Body (BOI)
- C - Company
- F - Firm
- G - Government
- H - HUF (undivided Hindu family)
- L - Local government
- J - Artificial Entity
- P - Individual (owner)
- T - Trust (AOP)
- F - LLP (limited liability partnership)
The fifth PAN character is the first of the characters:
- surname or name of the person, in the case of a "personal" PAN card, where the fourth character is "P" or
- the name of the organization, trust, company or organization in the case of the company / HUF / firm / AOP / trust / BOI / local authority / artificial court / government, where the fourth character is "C", "H", "F", "A "," T "," B "," L "," J "," G ". The last (tenth) character is an alphanumeric used as a checksum to verify
Rjz satvara
source share