@Mention
/@[A-Za-z0-9_]{3,30}/Matches a social media @mention — @ followed by 3–30 word characters.
79 curated, battle-tested regex patterns with live testing, multi-language code generation, and Zod integration. Click any pattern to open it in the sandbox.
/@[A-Za-z0-9_]{3,30}/Matches a social media @mention — @ followed by 3–30 word characters.
/\d{2}\s?\d{3}\s?\d{3}\s?\d{3}/Matches an Australian Business Number (ABN) — 11 digits, optionally space-separated in groups.
/^(?:[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.
/^([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.
/[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.
/bc1[ac-hj-np-z02-9]{6,87}/iMatches a Bitcoin native SegWit address in Bech32 format — starts with bc1 followed by 6–87 lowercase alphanumeric characters.
/\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.
/\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.
/\d{17}[\dXx]/Matches a Chinese national resident identity card number — 17 digits followed by one digit or X (checksum digit).
/(?: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.
/(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.
/(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.
/(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}/iMatches a valid domain name including subdomains and international TLDs.
/[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}/iRFC 5321 compliant email address validation. Supports subdomains, plus-addressing, and international TLDs.
/[a-z0-9][a-z0-9\-]{1,61}[a-z0-9]\.eth/iMatches an Ethereum Name Service domain — alphanumeric label(s) ending with .eth.
/0x[a-fA-F0-9]{40}/iMatches an Ethereum address — 0x followed by exactly 40 hexadecimal characters.
/0x[a-fA-F0-9]{64}/Matches an Ethereum transaction hash — 0x followed by exactly 64 hexadecimal characters.
/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.
/\d{9}/Matches a French SIREN (Système d'Identification du Répertoire des ENtreprises) number — 9 digits.
/\d{14}/Matches a French SIRET (Système d'Identification du Répertoire des Établissements) number — 14 digits.
/\d{5}/Matches a German postal code (Postleitzahl / PLZ) — exactly 5 digits.
/[1-9]\d{10}/Matches a German personal tax identification number (Steuerliche Identifikationsnummer) — 11 digits, first digit 1–9.
/[0-9a-f]{7,40}/iMatches a Git commit SHA — either short form (7+ chars) or full 40-character SHA-1 hash.
/-?([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.
/#[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.
/#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/CSS hex color code in #RGB or #RRGGBB format (case-insensitive).
/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*\)/iMatches a CSS HSL color value in the format hsl(H, S%, L%).
/<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*\/?>/gMatches an HTML opening or self-closing tag with optional attributes.
/[A-Z]{2}\d{2}[A-Z0-9]{4}\d{7}([A-Z0-9]?){0,16}/iMatches an International Bank Account Number (IBAN) — 2-letter country code, 2 check digits, and up to 30 alphanumeric characters.
/[A-Z]{5}\d{4}[A-Z]/Matches an Indian Permanent Account Number (PAN) — 10 characters: 5 uppercase letters, 4 digits, 1 uppercase letter.
/(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).
/(?: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.
/([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}/iMatches a full-form IPv6 address with 8 groups of 4 hexadecimal digits separated by colons.
/\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.
/\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).
/[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]/iMatches an Italian fiscal code (Codice Fiscale) — 16 alphanumeric characters encoding name, birth date, gender, and municipality.
/[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.
/-?([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.
/ln(bc|tb|bcrt)\d*[munp]?[a-z0-9]+/iMatches a Bitcoin Lightning Network payment invoice in BOLT-11 format — starts with lnbc, lntb, or lnbcrt.
/-?(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.
/([0-9a-fA-F]{2}[:\-]){5}[0-9a-fA-F]{2}/iMatches a MAC (Media Access Control) address in both colon-separated and hyphen-separated formats.
/^>+\s?(.+)$/mMatches a Markdown blockquote line beginning with > and captures the quoted text.
/(\*\*|__)(?!\s)(.+?)(?<!\s)\1/sMatches Markdown bold text wrapped in **double asterisks** or __double underscores__.
/^(#{1,6})\s+(.+)$/mMatches Markdown ATX-style headings — # through ###### followed by text. Captures both the level (number of #) and the heading text.
/^([-*_])\s*\1\s*\1[\s\1]*$/mMatches a Markdown horizontal rule — three or more dashes, asterisks, or underscores on a line.
/!\[([^\]]*)\]\(([^)]+)\)/gMatches a Markdown image tag  and captures both the alt text and the URL.
/(`{1,2})([^`]+)\1/Matches Markdown inline code wrapped in single `backticks` or ``double backticks``.
/(\*|_)(?!\s)(.+?)(?<!\s)\1/Matches Markdown italic text wrapped in *single asterisk* or _single underscore_.
/\[([^\]]+)\]\(([^)]+)\)/gMatches a Markdown hyperlink in [text](url) format and captures both the link text and URL.
/^(\s*)([-*+]|\d+\.)\s+(.+)$/mMatches Markdown unordered list items starting with -, *, or + and ordered items starting with a number.
/^\|(.+\|)+$/mMatches a Markdown GFM table row — cells separated by pipe | characters.
/[a-fA-F0-9]{32}/Matches an MD5 hash — exactly 32 hexadecimal characters.
/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.
/\+[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).
/(\+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.
/(\+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.
/\d{10}/Polish NIP (Numer Identyfikacji Podatkowej) — the 10-digit tax identification number used by businesses and self-employed individuals in Poland.
/\d{11}/Polish national identification number (PESEL) — an 11-digit number encoding date of birth, gender, and a checksum, assigned to every citizen.
/(\d{9}|\d{14})/Matches a Polish REGON (National Business Registry Number) — 9 digits for companies, 14 digits for local units.
/(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.
/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*\)/iMatches an RGB color value in the format rgb(R, G, B) where each channel is 0–255.
/(\d{10}|\d{12})/Matches a Russian taxpayer identification number (ИНН) — 10 digits for organisations, 12 digits for individuals.
/(?: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.
/[a-fA-F0-9]{64}/Matches a SHA-256 cryptographic hash — exactly 64 hexadecimal characters.
/[1-9A-HJ-NP-Za-km-z]{32,44}/Matches a Solana public key — 32–44 Base58 characters (no 0, O, I, l).
/[0-9XYZ]\d{7}[A-HJ-NP-TV-Z]/iMatches a Spanish National Identity Document number (NIF/DNI) — 8 digits followed by a letter, or an NIE starting with X, Y, or Z.
/(?=.*[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.
/[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?/iMatches a SWIFT/BIC (Bank Identifier Code) — 6-letter institution code + 2-letter country + optional 2-3 character branch.
/([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.
/[A-CEGHJ-PR-TW-Z]{2}\s?\d{2}\s?\d{2}\s?\d{2}\s?[A-D]/iMatches a UK National Insurance Number in the format AA 99 99 99 A.
/[A-Z]{1,2}\d[A-Z\d]?\s?\d[A-Z]{2}/iMatches a UK postcode in the standard format (e.g. SW1A 1AA, EC1A 1BB).
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&\/=]*)/iValidates HTTP and HTTPS URLs including subdomains, paths, query strings, and anchors.
/[a-z0-9]+(?:-[a-z0-9]+)*/Valid URL slug — lowercase alphanumeric characters separated by single hyphens, no leading or trailing hyphens.
/\d{2}-\d{7}/Matches a US EIN (Federal Tax ID) in the NN-NNNNNNN format used by the IRS.
/\d{3}-\d{2}-\d{4}/Matches a US Social Security Number (SSN) in the standard NNN-NN-NNNN format.
/\d{5}(-\d{4})?/Matches a US ZIP code in 5-digit or ZIP+4 (5-4) format.
/[a-zA-Z0-9](?:[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.
/[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/iMatches a UUID version 4 — randomly generated universally unique identifier in the standard 8-4-4-4-12 format.
/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_\-]{11})/iMatches a YouTube video URL in both youtube.com/watch?v= and youtu.be/ formats and extracts the 11-character video ID.