23 patterns
Identification Regex Patterns
Identification patterns for validating unique identifiers used across different systems and countries. From standard UUIDs in software systems to book ISBNs and national ID formats.
Common Use Cases
All Identification Patterns
US Social Security Number
Validates the US SSN format (9 digits with hyphens).
^\d{3}-\d{2}-\d{4}$AWS ARN
Validates Amazon Web Services Resource Name format
^arn:aws:[a-z0-9-]+:[a-z0-9-]*:[0-9]{12}:[a-zA-Z0-9/_-]+$Google Analytics ID
Validates Google Analytics tracking IDs (Universal and GA4)
^(?:UA-[0-9]+-[0-9]+|G-[0-9A-Z]+)$UUID v4
Validates a UUID version 4 (randomly generated identifier).
^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$ISBN-13
Validates ISBN-13 book identifiers with optional hyphens or spaces.
^97[89][- ]?(?:\d[- ]?){9}\d$EAN-13 Barcode
Validates EAN-13 product barcodes (13 digits).
^[0-9]{13}$NanoID
Validates default NanoID identifiers (21 URL-safe characters).
^[A-Za-z0-9_-]{21}$ULID
Validates Universally Unique Lexicographically Sortable Identifiers.
^[0-9A-HJKMNP-TV-Z]{26}$Vehicle Identification Number (VIN)
Validates a 17-character VIN (Vehicle Identification Number). Excludes letters I, O, Q to avoid digit confusion.
^[A-HJ-NPR-Z0-9]{17}$ISBN-10
Validates a 10-character ISBN. Last position can be X (representing 10 in mod-11 checksum).
^(?:\d{9}X|\d{10})$Brazil CPF
Validates the Brazilian CPF (Cadastro de Pessoas Físicas) formatted as 000.000.000-00.
^\d{3}\.\d{3}\.\d{3}-\d{2}$Brazil CNPJ
Validates the Brazilian CNPJ (Cadastro Nacional da Pessoa Jurídica) formatted as 00.000.000/0000-00.
^\d{2}\.\d{3}\.\d{3}\/\d{4}-\d{2}$Spain DNI / NIE
Validates Spanish DNI (8 digits + letter) and NIE (X/Y/Z + 7 digits + letter) identifiers.
^([0-9]{8}|[XYZ][0-9]{7})[A-Z]$DOI (Digital Object Identifier)
Validates an academic DOI (10.xxxx/yyyy).
^10\.\d{4,9}\/[-._;()\/:A-Za-z0-9]+$ORCID Researcher ID
Validates an ORCID identifier (4×4 digit groups, last digit can be X for checksum 10).
^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$US EIN (Employer Identification Number)
Validates a US Employer Identification Number (xx-xxxxxxx).
^\d{2}-\d{7}$ISSN (Periodical Number)
Validates the ISSN format for periodicals (NNNN-NNNX, last digit can be X for checksum 10).
^\d{4}-\d{3}[\dX]$UPC-A Barcode
Validates the structural format of a UPC-A barcode (12 digits).
^\d{12}$GTIN-8 Barcode
Validates the GTIN-8 / EAN-8 barcode format (8 digits).
^\d{8}$GCP Service Account Email
Validates a Google Cloud service account email (project-id.iam.gserviceaccount.com).
^[a-z][a-z0-9-]{5,29}@[a-z0-9-]+\.iam\.gserviceaccount\.com$Notion Page ID
Matches a Notion page or database ID (32 hex chars, with or without dashes).
^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$Linear Issue ID
Matches a Linear issue identifier (e.g., ENG-123, OPS-4567).
^[A-Z]{2,5}-\d+$Shipping Tracking Number (UPS / FedEx / USPS)
Matches common shipping tracking number formats: UPS, FedEx, USPS, and international registered mail.
^(?:1Z[0-9A-Z]{16}|\d{12}|\d{15}|\d{20}|\d{22}|[A-Z]{2}\d{9}[A-Z]{2})$Frequently Asked Questions
What is the difference between UUID v4 and v1?
v1 is time-based (contains timestamp and MAC address). v4 is randomly generated. v4 is more common in modern apps for privacy reasons.
How do I generate a UUID in JavaScript?
Use crypto.randomUUID() in modern browsers/Node.js, or the uuid npm package for broader compatibility.
How do I validate an ISBN-13?
Use the ISBN-13 pattern which accepts both plain (9780306406157) and formatted (978-0-306-40615-7) versions.
Looking for patterns in other categories?
Browse all 300 patterns