RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Pakistan CNIC
Expression
^[1-4]{1}[0-9]{4}(-)?[0-9]{7}(-)?[0-9]{1}$
Description
This expression is used to validate CNIC numbers. The number must start with either 1,2,3 or 4 which represent the province. The hyphen is optional. But if given must be at the correct index (i.e. first one after 5 numbers and second one before the last number). The total length of numbers is 13.
Matches
42222-1010101-1, 11111-1111111-1, 1111111111111, 11111-11111111
Non-Matches
12345678901, 9191-9393939-31
Author Rating: Not yet rated. Noman Aftab
   Displaying page 1 of 1 pages; Items 1 to 1

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials