Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog

Pattern Catalog

106 curated, battle-tested regex patterns with live testing, multi-language code generation, and Zod integration. Click any pattern to open it in the sandbox.

106Patterns
22Categories
5Languages
Social

@Mention

/@[A-Za-z0-9_]{3,30}/

Matches a social media @mention — @ followed by 3–30 word characters.

#mention#social#username
Identity

Australian ABN

/\d{2}\s?\d{3}\s?\d{3}\s?\d{3}/

Matches an Australian Business Number (ABN) — 11 digits, optionally space-separated in groups.

#abn#australia#australian
Cloud

AWS ARN

/arn:(?:aws|aws-cn|aws-us-gov):([a-z0-9\-]+):([a-z0-9\-]*):([0-9]{12}|\*)?:(.+)/

Validates Amazon Web Services ARNs (Amazon Resource Names) across all AWS services and partitions.

#aws#amazon#arn
Security

Base64 Encoded String

/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/

Matches a valid Base64-encoded string with proper padding using = characters.

#base64#encoding#data
Crypto

BIP-39 Mnemonic Phrase

/^([a-z]+\s){11,23}[a-z]+$/

Matches a BIP-39 mnemonic seed phrase — 12, 15, 18, 21, or 24 lowercase English words separated by single spaces.

#bip39#mnemonic#seed
Crypto

Bitcoin Address (Legacy)

/[13][a-km-zA-HJ-NP-Z1-9]{25,34}/

Matches a legacy Bitcoin address — P2PKH (starting with 1) or P2SH (starting with 3), 25–34 Base58 characters.

#bitcoin#btc#crypto
Crypto

Bitcoin Bech32 Address (SegWit)

/bc1[ac-hj-np-z02-9]{6,87}/i

Matches a Bitcoin native SegWit address in Bech32 format — starts with bc1 followed by 6–87 lowercase alphanumeric characters.

#bitcoin#btc#bech32
Identity

Brazilian CNPJ

/\d{2}\.?\d{3}\.?\d{3}\/?\d{4}-?\d{2}/

Matches a Brazilian CNPJ (Cadastro Nacional da Pessoa Jurídica) — company identifier in formatted or unformatted form.

#cnpj#brazil#company
Identity

Brazilian CPF

/\d{3}\.?\d{3}\.?\d{3}-?\d{2}/

Matches a Brazilian CPF (Cadastro de Pessoas Físicas) number in formatted (NNN.NNN.NNN-NN) or unformatted (NNNNNNNNNNN) form.

#cpf#brazil#brazilian
Identity

Canadian SIN

/[0-9]{3}[\s\-]?[0-9]{3}[\s\-]?[0-9]{3}/

Validates Canadian Social Insurance Numbers (SIN): 9 digits optionally formatted as NNN-NNN-NNN.

#sin#canada#ca
Identity

Chinese Resident ID

/\d{17}[\dXx]/

Matches a Chinese national resident identity card number — 17 digits followed by one digit or X (checksum digit).

#china#chinese#resident-id
Dev Tools

Conventional Commit Message

/(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\([a-zA-Z0-9_-]+\))?!?: .{1,100}/

Validates git commit messages adhering to the Conventional Commits specification.

#conventional-commits#commit#git
Finance

Credit Card Number

/(?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})/

Generic credit card number validator supporting Visa, Mastercard, American Express, and Discover card formats.

#payment#credit-card#finance
Dev Tools

Cron Expression

/(?:(?:\*|\d+(?:-\d+)?)(?:\/\d+)?(?:,(?:\*|\d+(?:-\d+)?)(?:\/\d+)?)*\s+){4}(?:\*|\d+(?:-\d+)?)(?:\/\d+)?(?:,(?:\*|\d+(?:-\d+)?)(?:\/\d+)?)*/

Validates cron schedule expressions (5 fields: minute, hour, day of month, month, day of week) structurally.

#cron#schedule#task
Web

CSS Custom Property (Variable)

/--[a-zA-Z0-9_-]+/

Validates CSS custom property (variable) names starting with double dashes (--).

#css#variable#custom-property
Web

CSS oklch() Color

/oklch\(\s*(?:none|[0-9]*\.?[0-9]+%?)\s+(?:none|[0-9]*\.?[0-9]+)\s+(?:none|[0-9]*\.?[0-9]+(?:deg)?)(?:\s*\/\s*(?:[0-9]*\.?[0-9]+%?))?\s*\)/i

Validates CSS oklch() color function values as defined in CSS Color Level 4. Supports lightness (0–1), chroma (0–0.4), hue (0–360), and optional alpha.

#css#color#oklch
Date & Time

Date (European Format)

/(0?[1-9]|[12]\d|3[01])[.\-\/](0?[1-9]|1[0-2])[.\-\/](\d{4})/

Matches a European-style date in DD/MM/YYYY, DD.MM.YYYY, or DD-MM-YYYY format.

#date#european#dd/mm/yyyy
Date & Time

Date (US Format)

/(0?[1-9]|1[0-2])\/(0?[1-9]|[12]\d|3[01])\/(\d{4})/

Matches a US-style date in MM/DD/YYYY format.

#date#us#mm/dd/yyyy
Security

Discord Bot Token

/[MNOT][A-Za-z0-9_-]{23,25}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{27,38}/

Validates Discord bot API tokens consisting of user ID base64, timestamp, and HMAC hash.

#discord#bot#token
DevOps

Docker Image Name

/(?:[a-z0-9][a-z0-9.\-]*(?::[0-9]+)?/)?[a-z0-9][a-z0-9._\-]*(?:/[a-z0-9._\-]+)*(?::[a-zA-Z0-9._\-]+|@sha256:[a-f0-9]{64})?/

Validates Docker image references including optional registry host, namespace, name, tag, and digest.

#docker#container#image
Internet

Domain Name

/(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}/i

Matches a valid domain name including subdomains and international TLDs.

#domain#internet#dns
Internet

Email Address

/[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}/i

RFC 5321 compliant email address validation. Supports subdomains, plus-addressing, and international TLDs.

#email#internet#contact
Crypto

ENS Name (Ethereum Name Service)

/[a-z0-9][a-z0-9\-]{1,61}[a-z0-9]\.eth/i

Matches an Ethereum Name Service domain — alphanumeric label(s) ending with .eth.

#ens#ethereum#domain
Crypto

Ethereum Address

/0x[a-fA-F0-9]{40}/i

Matches an Ethereum address — 0x followed by exactly 40 hexadecimal characters.

#ethereum#eth#evm
Crypto

Ethereum Transaction Hash

/0x[a-fA-F0-9]{64}/

Matches an Ethereum transaction hash — 0x followed by exactly 64 hexadecimal characters.

#ethereum#eth#txhash
Finance

EU VAT Number

/(?:ATU[0-9]{8}|BE[0-9]{10}|BG[0-9]{9,10}|CY[0-9]{8}[A-Z]|CZ[0-9]{8,10}|DE[0-9]{9}|DK[0-9]{8}|EE[0-9]{9}|EL[0-9]{9}|ES[A-Z0-9][0-9]{7}[A-Z0-9]|FI[0-9]{8}|FR[A-Z0-9]{2}[0-9]{9}|HR[0-9]{11}|HU[0-9]{8}|IE[0-9]{7}[A-Z]{1,2}|IT[0-9]{11}|LT(?:[0-9]{9}|[0-9]{12})|LU[0-9]{8}|LV[0-9]{11}|MT[0-9]{8}|NL[0-9]{9}B[0-9]{2}|PL[0-9]{10}|PT[0-9]{9}|RO[0-9]{2,10}|SE[0-9]{12}|SI[0-9]{8}|SK[0-9]{10})/i

Validates European Union VAT numbers across all 27 member states. Each country has a 2-letter ISO prefix followed by 8–12 alphanumeric characters.

#vat#eu#europe
Address

French Postal Code

/0[1-9]\d{3}|[1-8]\d{4}|9[0-5]\d{3}/

Matches a French postal code — exactly 5 digits, starting with 0–9.

#postal#france#french
Identity

French SIREN Number

/\d{9}/

Matches a French SIREN (Système d'Identification du Répertoire des ENtreprises) number — 9 digits.

#siren#france#company
Identity

French SIRET Number

/\d{14}/

Matches a French SIRET (Système d'Identification du Répertoire des Établissements) number — 14 digits.

#siret#france#company
Phone

German Phone Number

/(?:\+49|0)[\s.\-]?(?:\(\d{1,5}\)|\d{1,5})[\s.\-]?\d{1,9}(?:[\s.\-]\d{1,9})*/

Validates German phone numbers in international (+49) and domestic (0) formats, with optional spaces, hyphens, or dots as separators.

#phone#germany#de
Address

German Postal Code (PLZ)

/\d{5}/

Matches a German postal code (Postleitzahl / PLZ) — exactly 5 digits.

#plz#postal#germany
Identity

German Tax ID (Steuer-IdNr)

/[1-9]\d{10}/

Matches a German personal tax identification number (Steuerliche Identifikationsnummer) — 11 digits, first digit 1–9.

#steuerid#germany#german
Developer Tools

Git Branch Name

/(?:[a-zA-Z0-9_.-]+(?:\/[a-zA-Z0-9_.-]+)*)/

Validates standard Git branch names (e.g. feature/login, bugfix/issue-123, main, release/v1.0.4).

#git#branch#vcs
Dev

Git Commit SHA

/[0-9a-f]{7,40}/i

Matches a Git commit SHA — either short form (7+ chars) or full 40-character SHA-1 hash.

#git#sha#commit
Internet

GitHub Repository

/[a-zA-Z0-9](?:[a-zA-Z0-9._\-]{0,37}[a-zA-Z0-9])?/[a-zA-Z0-9][a-zA-Z0-9._\-]{0,98}/

Validates GitHub repository references in owner/repo format. Owner and repo names must be 1–100 characters and contain only alphanumerics, hyphens, underscores, or dots.

#github#git#repository
Geo

GPS Coordinates

/-?([0-8]?\d(\.\d+)?|90(\.0+)?)\s*,\s*-?(1[0-7]\d(\.\d+)?|[0-9]?\d(\.\d+)?|180(\.0+)?)/

Matches a latitude,longitude coordinate pair separated by a comma.

#coordinates#gps#geo
Social

Hashtag

/#[A-Za-z][A-Za-z0-9_]*/

Matches a social media hashtag — # followed by one or more word characters (letters, digits, underscores), starting with a letter.

#hashtag#social#twitter
Web

Hex Color

/#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/

CSS hex color code in #RGB or #RRGGBB format (case-insensitive).

#color#css#hex
Design

HSL Color

/hsl\(\s*(360|3[0-5]\d|[12]\d{2}|[1-9]\d|\d)\s*,\s*(100|[1-9]\d|\d)%\s*,\s*(100|[1-9]\d|\d)%\s*\)/i

Matches a CSS HSL color value in the format hsl(H, S%, L%).

#hsl#color#css
Web

HTML Tag

/<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*\/?>/g

Matches an HTML opening or self-closing tag with optional attributes.

#html#tag#web
Finance

IBAN

/[A-Z]{2}\d{2}[A-Z0-9]{4}\d{7}([A-Z0-9]?){0,16}/i

Matches an International Bank Account Number (IBAN) — 2-letter country code, 2 check digits, and up to 30 alphanumeric characters.

#iban#bank#finance
Identity

Indian PAN Card

/[A-Z]{5}\d{4}[A-Z]/

Matches an Indian Permanent Account Number (PAN) — 10 characters: 5 uppercase letters, 4 digits, 1 uppercase letter.

#pan#india#indian
Crypto

IPFS CID

/(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[a-z2-7]{58,})/

Matches an IPFS Content Identifier (CIDv0 starting with Qm, or CIDv1 starting with bafy/bafk).

#ipfs#cid#content-address
Network

IPv4 Address

/(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)/

Validates a standard IPv4 address ensuring each octet is 0–255.

#ip#ipv4#networking
Network

IPv6 Address

/([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}/i

Matches a full-form IPv6 address with 8 groups of 4 hexadecimal digits separated by colons.

#ipv6#network#internet
Content

ISBN-13

/(?:978|979)[- ]?\d{1,5}[- ]?\d{1,7}[- ]?\d{1,7}[- ]?\d{1}/

Validates 13-digit International Standard Book Numbers (ISBN-13) with optional hyphens or spaces.

#isbn#isbn-13#book
Date & Time

ISO 8601 Date

/\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])/

ISO 8601 date format (YYYY-MM-DD) with month and day range validation.

#date#iso#time
Date & Time

ISO 8601 DateTime

/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})/

Matches an ISO 8601 datetime string with timezone offset or Z (UTC).

#iso8601#datetime#timestamp
Identity

Italian Codice Fiscale

/[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]/i

Matches an Italian fiscal code (Codice Fiscale) — 16 alphanumeric characters encoding name, birth date, gender, and municipality.

#codice-fiscale#italy#italian
Security

JWT Token

/[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/

Matches a JSON Web Token (JWT) — three Base64URL-encoded segments separated by dots.

#jwt#token#auth
Geo

Latitude

/-?([0-8]?\d(\.\d{1,6})?|90(\.0{1,6})?)/

Matches a geographic latitude coordinate between -90 and +90 degrees, with up to 6 decimal places.

#latitude#geo#coordinates
Crypto

Lightning Network Invoice (BOLT-11)

/ln(bc|tb|bcrt)\d*[munp]?[a-z0-9]+/i

Matches a Bitcoin Lightning Network payment invoice in BOLT-11 format — starts with lnbc, lntb, or lnbcrt.

#lightning#bitcoin#bolt11
Geo

Longitude

/-?(1[0-7]\d(\.\d{1,6})?|[0-9]?\d(\.\d{1,6})?|180(\.0{1,6})?)/

Matches a geographic longitude coordinate between -180 and +180 degrees, with up to 6 decimal places.

#longitude#geo#coordinates
Network

MAC Address

/([0-9a-fA-F]{2}[:\-]){5}[0-9a-fA-F]{2}/i

Matches a MAC (Media Access Control) address in both colon-separated and hyphen-separated formats.

#mac#network#hardware
Markdown

Markdown Blockquote

/^>+\s?(.+)$/m

Matches a Markdown blockquote line beginning with > and captures the quoted text.

#markdown#blockquote#quote
Markdown

Markdown Bold

/(\*\*|__)(?!\s)(.+?)(?<!\s)\1/s

Matches Markdown bold text wrapped in **double asterisks** or __double underscores__.

#markdown#bold#strong
Markdown

Markdown Heading

/^(#{1,6})\s+(.+)$/m

Matches Markdown ATX-style headings — # through ###### followed by text. Captures both the level (number of #) and the heading text.

#markdown#heading#h1
Markdown

Markdown Horizontal Rule

/^([-*_])\s*\1\s*\1(?:\s|\1)*$/m

Matches a Markdown horizontal rule — three or more dashes, asterisks, or underscores on a line.

#markdown#horizontal-rule#hr
Markdown

Markdown Image

/!\[([^\]]*)\]\(([^)]+)\)/g

Matches a Markdown image tag ![alt text](url) and captures both the alt text and the URL.

#markdown#image#img
Markdown

Markdown Inline Code

/(`{1,2})([^`]+)\1/

Matches Markdown inline code wrapped in single `backticks` or ``double backticks``.

#markdown#code#inline
Markdown

Markdown Italic

/(\*|_)(?!\s)(.+?)(?<!\s)\1/

Matches Markdown italic text wrapped in *single asterisk* or _single underscore_.

#markdown#italic#emphasis
Web

Markdown Link

/\[([^\]]+)\]\(([^)]+)\)/g

Matches a Markdown hyperlink in [text](url) format and captures both the link text and URL.

#markdown#link#url
Markdown

Markdown List Item

/^(\s*)([-*+]|\d+\.)\s+(.+)$/m

Matches Markdown unordered list items starting with -, *, or + and ordered items starting with a number.

#markdown#list#ul
Markdown

Markdown Table Row

/^\|(.+\|)+$/m

Matches a Markdown GFM table row — cells separated by pipe | characters.

#markdown#table#gfm
Security

MD5 Hash

/[a-fA-F0-9]{32}/

Matches an MD5 hash — exactly 32 hexadecimal characters.

#md5#hash#checksum
Web

MIME Media Type

/(?:application|audio|font|example|image|message|model|multipart|text|video)\/[a-zA-Z0-9!#$&^_.+-]+(?:\s*;\s*[a-zA-Z0-9._-]+=[a-zA-Z0-9._-]+)*/i

Validates standard MIME / media type strings (e.g. application/json, image/png, text/html).

#mime#media-type#content-type
Crypto

Monero Address

/4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}/

Matches a Monero (XMR) standard address — starts with 4 and is exactly 95 Base58 characters.

#monero#xmr#crypto
Database

MongoDB Connection URI

/mongodb(?:\+srv)?:\/\/(?:[a-zA-Z0-9-_]+:[a-zA-Z0-9-_]+@)?[a-zA-Z0-9.-]+(?::\d+)?(?:\/[a-zA-Z0-9-_]+)?(?:\?.+)?/

Validates MongoDB connection strings, supporting both standard 'mongodb://' and DNS-seedlist 'mongodb+srv://' protocols.

#mongodb#database#connection-string
Developer Tools

NPM Package Name

/(?:@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*/

Validates scoped and unscoped NPM package names according to npm naming rules.

#npm#package#javascript
Dev Tools

OpenAI API Key

/sk-proj-[a-zA-Z0-9]{40,100}/

Validates OpenAI API keys, specifically supporting the standard project keys starting with 'sk-proj-'.

#openai#api#key
Phone

Phone — E.164 International

/\+[1-9]\d{1,14}/

Matches an international phone number in E.164 format: + followed by country code and subscriber number (max 15 digits total).

#phone#e164#international
Phone

Phone — UK

/(\+44\s?|0)(\d{2,4}\s?\d{3,4}\s?\d{3,4}|\d{10})/

Matches UK phone numbers in standard formats, starting with 0 or +44.

#phone#uk#british
Phone

Phone — US

/(\+1[\s\-]?)?\(?\d{3}\)?[\s\-]?\d{3}[\s\-]?\d{4}/

Matches a US phone number in various formats: (555) 867-5309, 555-867-5309, 5558675309, or with +1 country code.

#phone#us#american
Finance

Polish NIP (Tax ID)

/(?:\d{10}|\d{3}-\d{3}-\d{2}-\d{2}|\d{3}-\d{2}-\d{2}-\d{3})/

Polish NIP (Numer Identyfikacji Podatkowej) — the 10-digit tax identification number used by businesses and self-employed individuals in Poland, supported in unhyphenated and official hyphenated formats.

#poland#nip#tax
Identity

Polish PESEL

/\d{11}/

Polish national identification number (PESEL) — an 11-digit number encoding date of birth, gender, and a checksum, assigned to every citizen.

#poland#pesel#identity
Identity

Polish REGON

/(?:\d{9}|\d{14})/

Matches a Polish REGON (National Business Registry Number) — 9 digits for businesses and companies, 14 digits for local administrative units.

#regon#poland#polish
Finance

Polish VAT Number (VAT-UE)

/(?:PL)?[ -]?(?:\d{10}|\d{3}-\d{3}-\d{2}-\d{2}|\d{3}-\d{2}-\d{2}-\d{3})/i

Validates Polish VAT identification numbers (VAT-UE / NIP do celów VAT). Matches standard 10-digit NIP numbers with optional or required 'PL' country prefix and official Polish hyphenation formats.

#vat#poland#polish
Network

Port Number

/(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)/

Matches a valid TCP/UDP port number from 0 to 65535.

#port#network#tcp
Database

Redis Connection URI

/rediss?:\/\/(?:(?:[^:]+)?(?::(?:[^@]+))?@)?(?:[a-zA-Z0-9.-]+|\d{1,3}(?:\.\d{1,3}){3}):\d{1,5}(?:\/\d{1,2})?/

Validates Redis and Redis SSL connection URLs (redis://, rediss://) with optional user, password, port, and DB index.

#redis#uri#url
Design

RGB Color

/rgb\(\s*(25[0-5]|2[0-4]\d|1?\d\d?)\s*,\s*(25[0-5]|2[0-4]\d|1?\d\d?)\s*,\s*(25[0-5]|2[0-4]\d|1?\d\d?)\s*\)/i

Matches an RGB color value in the format rgb(R, G, B) where each channel is 0–255.

#rgb#color#css
Identity

Russian INN (ИНН)

/(\d{10}|\d{12})/

Matches a Russian taxpayer identification number (ИНН) — 10 digits for organisations, 12 digits for individuals.

#inn#russia#russian
Dev

Semantic Version

/(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)(?:-(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?/

SemVer 2.0 compliant version string including optional pre-release and build metadata.

#semver#version#npm
Developer Tools

SemVer Range Specifier

/(?:[\^~]|>=?|<=?|==?)?\s*v?(?:0|[1-9]\d*)(?:\.(?:0|[1-9]\d*|\*|x))?(?:\.(?:0|[1-9]\d*|\*|x))?(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?/

Validates Semantic Versioning (SemVer) ranges such as ^1.2.3, ~0.1.0, >=1.0.0, or 1.x.

#semver#version#range
Security

SHA-256 Hash

/[a-fA-F0-9]{64}/

Matches a SHA-256 cryptographic hash — exactly 64 hexadecimal characters.

#sha256#hash#crypto
Security

Slack Incoming Webhook URL

/https:\/\/hooks\.slack\.com\/services\/T[a-zA-Z0-9_]{8,11}\/B[a-zA-Z0-9_]{8,11}\/[a-zA-Z0-9_]{24}/

Validates Slack incoming webhook URLs (https://hooks.slack.com/services/T.../B.../...).

#slack#webhook#security
Crypto

Solana Address

/[1-9A-HJ-NP-Za-km-z]{32,44}/

Matches a Solana public key — 32–44 Base58 characters (no 0, O, I, l).

#solana#sol#crypto
Identity

Spanish NIF / DNI

/[0-9XYZ]\d{7}[A-HJ-NP-TV-Z]/i

Matches a Spanish National Identity Document number (NIF/DNI) — 8 digits followed by a letter, or an NIE starting with X, Y, or Z.

#nif#dni#nie
Database

SQL Identifier

/[a-zA-Z_][a-zA-Z0-9_]*|"[a-zA-Z_][a-zA-Z0-9_]*"|`[a-zA-Z_][a-zA-Z0-9_]*`/

Validates SQL table, column, and schema names (unquoted or quoted with double quotes or backticks).

#sql#database#identifier
Security

SSH Public Key

/(ssh-rsa|ssh-dss|ssh-ed25519|ecdsa-sha2-nistp256|ecdsa-sha2-nistp384|ecdsa-sha2-nistp521)\s+[A-Za-z0-9+/=]+(?:\s+.+)?/

Validates SSH public keys, supporting common algorithms like ssh-rsa, ssh-ed25519, ssh-dss, and ecdsa variants.

#ssh#public-key#security
Finance

Stripe API Key

/(?:pk|sk|rk)_(?:live|test)_[a-zA-Z0-9]{20,99}/

Validates Stripe publishable and secret API keys in both live and test modes.

#stripe#api-key#payment
Security

Strong Password

/(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&#^()\-_+=])[A-Za-z\d@$!%*?&#^()\-_+=]{8,}/

Matches a strong password: minimum 8 characters with at least one uppercase letter, one lowercase letter, one digit, and one special character.

#password#security#auth
Finance

SWIFT / BIC Code

/[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?/i

Matches a SWIFT/BIC (Bank Identifier Code) — 6-letter institution code + 2-letter country + optional 2-3 character branch.

#swift#bic#bank
Date & Time

Time (24-hour)

/([01]?[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?/

Matches a time in 24-hour format. Supports both HH:MM and HH:MM:SS.

#time#24h#clock
Identity

UK National Insurance Number (NINO)

/[A-CEGHJ-PR-TW-Z]{2}\s?\d{2}\s?\d{2}\s?\d{2}\s?[A-D]/i

Matches a UK National Insurance Number in the format AA 99 99 99 A.

#nino#uk#national-insurance
Identity

UK NHS Number

/\d{3}[\s\-]?\d{3}[\s\-]?\d{4}/

Validates UK National Health Service (NHS) numbers: 10 digits optionally separated by spaces in groups of 3-3-4.

#nhs#uk#health
Address

UK Postcode

/[A-Z]{1,2}\d[A-Z\d]?\s?\d[A-Z]{2}/i

Matches a UK postcode in the standard format (e.g. SW1A 1AA, EC1A 1BB).

#postcode#postal#uk
Identifiers

ULID

/[0-7][0-9A-HJKMNP-TV-Z]{25}/i

Validates 26-character Crockford Base32 Universally Unique Lexicographically Sortable Identifier (ULID) strings.

#ulid#identifier#uuid
Internet

URL (HTTP/HTTPS)

/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&\/=]*)/i

Validates HTTP and HTTPS URLs including subdomains, paths, query strings, and anchors.

#url#internet#link
Web

URL Slug

/[a-z0-9]+(?:-[a-z0-9]+)*/

Valid URL slug — lowercase alphanumeric characters separated by single hyphens, no leading or trailing hyphens.

#slug#url#web
Identity

US Employer Identification Number (EIN)

/\d{2}-\d{7}/

Matches a US EIN (Federal Tax ID) in the NN-NNNNNNN format used by the IRS.

#ein#us#tax
Identity

US Passport Number

/[A-Z]{1,2}[0-9]{7,8}/

Validates United States passport numbers: 9 alphanumeric characters starting with 1-2 letters followed by digits.

#passport#us#usa
Identity

US Social Security Number

/\d{3}-\d{2}-\d{4}/

Matches a US Social Security Number (SSN) in the standard NNN-NN-NNNN format.

#ssn#us#identity
Address

US ZIP Code

/\d{5}(-\d{4})?/

Matches a US ZIP code in 5-digit or ZIP+4 (5-4) format.

#zip#postal#us
Social

Username

/^[a-zA-Z0-9](?!.*[-_]{2})[a-zA-Z0-9_\-]{1,18}[a-zA-Z0-9]$/

Matches a valid username: 3–20 characters, letters, digits, hyphens, and underscores. No leading/trailing hyphens or underscores.

#username#user#handle
Security

UUID v4

/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i

Matches a UUID version 4 — randomly generated universally unique identifier in the standard 8-4-4-4-12 format.

#uuid#guid#identifier
Internet

YouTube Video URL

/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_\-]{11})/i

Matches a YouTube video URL in both youtube.com/watch?v= and youtu.be/ formats and extracts the 11-character video ID.

#youtube#video#url