Skip to content

Instantly share code, notes, and snippets.

@MaxXxiMast
Last active April 12, 2018 14:02
Show Gist options
  • Save MaxXxiMast/549354950bbd24bb461691a3b3cca7d5 to your computer and use it in GitHub Desktop.
Save MaxXxiMast/549354950bbd24bb461691a3b3cca7d5 to your computer and use it in GitHub Desktop.
Regex - panNum.match('/[A-Za-z]{3}[p,P,c,C,h,H,f,F,a,A,t,T,b,B,l,L,j,J,g,G]{1}[A-Za-z]{1}\d{4}[A-Za-z]{1}/g')
PAN structure is as follows: AAAAA9999A: First five characters are letters, next 4 numerals, last character letter.
1) The first three letters are sequence of alphabets from AAA to zzz
2) The fourth character informs about the type of holder of the Card. Each assesse is unique:`
C — Company
P — Person
H — HUF(Hindu Undivided Family)
F — Firm
A — Association of Persons (AOP)
T — AOP (Trust)
B — Body of Individuals (BOI)
L — Local Authority
J — Artificial Judicial Person
G — Government
3) The fifth character of the PAN is the first character
(a) of the surname / last name of the person, in the case of
a "Personal" PAN card, where the fourth character is "P" or
(b) of the name of the Entity/ Trust/ Society/ Organisation
in the case of Company/ HUF/ Firm/ AOP/ BOI/ Local Authority/ Artificial Jurdical Person/ Govt,
where the fourth character is "C","H","F","A","T","B","L","J","G".
4) The last character is a alphabetic check digit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment