Validate INDIAN PAN Number Using Regular expression

Posted by Ndebata under ASP.NET category on | Points: 40 | Views : 26954

Indian PAN is as follows: AAAAA9999A:
Where First five characters are letters, next 4 numerals, last character letter
One rule there the fourth character is choosen from a list Alphabates as bellows.

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 Juridical Person
G - Govt

Hence I will create a regular expression
as bellow


Here I have a textbox and a regular expression validator in my aspx page as bellow.

<asp:TextBox ID="txtPan" runat="server" ></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
ControlToValidate="txtPan" runat="server" ErrorMessage="Invalid PAN"


Comments or Responses

Login to post response