Generic Passport Number
Identity^[A-Z0-9]{6,9}$Matches a 6 to 9 character uppercase alphanumeric string, the common shape of passport numbers across many countries.
150 tested patterns
150 of 150 patterns
^[A-Z0-9]{6,9}$Matches a 6 to 9 character uppercase alphanumeric string, the common shape of passport numbers across many countries.
^(?:[0-9]{9}|[A-Z][0-9]{8})$Matches the two common US passport book number shapes: nine digits, or one letter followed by eight digits.
^[0-9]{9}$Matches the nine-digit shape used by United Kingdom passport numbers.
^[A-PR-WY][1-9][0-9]{5}[1-9]$Matches the Indian passport number shape: one letter followed by seven digits, with the first and last digit non-zero.
^(?!000|666|9[0-9]{2})[0-9]{3}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$Matches the AAA-GG-SSSS shape of a US Social Security number while rejecting area, group and serial values that are never issued.
^[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z] ?[0-9]{2} ?[0-9]{2} ?[0-9]{2} ?[A-D]$Matches a UK National Insurance number: two prefix letters, six digits and a suffix letter A to D, with optional spaces.
^[2-9][0-9]{3} ?[0-9]{4} ?[0-9]{4}$Matches the 12-digit Aadhaar shape, optionally grouped as 4-4-4 with spaces, with a first digit from 2 to 9.
^[A-Z]{3}[ABCFGHLJPT][A-Z][0-9]{4}[A-Z]$Matches the 10-character Indian Permanent Account Number shape, including the holder-type letter in position four.
^[1-79][0-9]{2}[ -]?[0-9]{3}[ -]?[0-9]{3}$Matches a nine-digit Canadian Social Insurance Number in 3-3-3 groups with optional spaces or dashes.
^P[A-Z<](?:[A-Z]{3}|D<<)[A-Z<]{39}$Matches the first 44-character line of a passport machine readable zone, which holds the document type, issuing state and name.
^[A-Z]{0,2}[0-9]{6,12}$Matches a broad US driver licence number shape: up to two leading letters followed by 6 to 12 digits.
^(?:AT|BE|BG|CY|CZ|DE|DK|EE|EL|ES|FI|FR|HR|HU|IE|IT|LT|LU|LV|MT|NL|PL|PT|RO|SE|SI|SK)[0-9A-Z]{8,12}$Matches a European Union VAT identification number: an EU country prefix followed by 8 to 12 letters or digits.
^(?:[0-9]{8}|[XYZ][0-9]{7})[A-HJ-NP-TV-Z]$Matches a Spanish DNI (eight digits and a letter) or NIE (X, Y or Z, seven digits and a letter).
^784-?[0-9]{4}-?[0-9]{7}-?[0-9]$Matches the 15-digit Emirates ID shape 784-YYYY-NNNNNNN-C, with or without dashes.
^[12][0-9]{9}$Matches a ten-digit Saudi identity number starting with 1 for citizens or 2 for residents (Iqama).
^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$Matches a typical email address with a local part, an @ sign, a domain and a top-level domain of two or more letters.
^\+[1-9][0-9]{7,14}$Matches a phone number in E.164 format: a plus sign, a country code that does not start with 0, and up to 15 digits in total.
^(?:\+1[ .-]?)?\(?[2-9][0-9]{2}\)?[ .-]?[2-9][0-9]{2}[ .-]?[0-9]{4}$Matches a ten-digit North American number with optional +1, optional parentheses and space, dot or dash separators.
^(?:\+44 ?|0)[1-9](?: ?[0-9]){8,9}$Matches a UK landline or mobile number starting with 0 or +44, with optional spaces between digits.
^(?:\+91[ -]?|0)?[6-9][0-9]{9}$Matches a ten-digit Indian mobile number starting with 6 to 9, with an optional +91 or 0 prefix.
^(?:\+971[ -]?|0)5[024568][ -]?[0-9]{3}[ -]?[0-9]{4}$Matches a UAE mobile number such as 050 123 4567 or +971 50 123 4567, using the 50, 52, 54, 55, 56 or 58 prefixes.
^[0-9]{5}(?:-[0-9]{4})?$Matches a five-digit US ZIP code or a ZIP+4 code such as 10001-1234.
^[A-Z]{1,2}[0-9][A-Z0-9]? ?[0-9][A-Z]{2}$Matches a UK postcode such as SW1A 1AA, M1 1AE or B33 8TH, with an optional space before the inward code.
^[ABCEGHJ-NPRSTVXY][0-9][ABCEGHJ-NPRSTV-Z] ?[0-9][ABCEGHJ-NPRSTV-Z][0-9]$Matches a Canadian postal code in the A1A 1A1 pattern, excluding letters Canada Post never uses.
A regular expression checks the shape of text. It cannot tell whether a card number passes its checksum, whether an email inbox exists, or whether an ID number was really issued. Where that matters, the pattern carries a caveat. Use regex as a fast first filter, then confirm with the proper check in code. Read Validation vs extraction for the difference between anchored and unanchored patterns.