Skip to content

International regexes

Python regexes for identifiers used everywhere: email, IBAN, payment cards, IMEI, crypto addresses and seed phrases, MRZ, VIN, parcels, API keys and hashes.

186 regexes, from regular_regexes/intl/regexes.json, called as rre.<name>(text).

Identity documents (2) · Companies and tax (2) · Banking and payments (12) · Crypto (25) · Phones and SIM cards (10) · Messaging and social media (25) · Web and network (11) · Keys, passwords and hashes (25) · Devices, apps and paths (29) · Files and media (4) · Dates and times (9) · Places and addresses (7) · Vehicles, ships and parcels (21) · Products and publications (2) · Text (2)

Identity documents

function checksum validator
rre.mrz_id_card mrz_td1
rre.mrz_passport mrz_td3

mrz_id_card

Machine-readable zone (MRZ) of an identity card, first line (ICAO TD1): 30 characters with the document type, issuing country and document number, like I<UTOD231458907<<<<<<<<<<<<<<<.

rre.mrz_id_card(text)

(?<![A-Z0-9<])[IAC][A-Z<][A-Z<]{3}[A-Z0-9<]{25}(?![A-Z0-9<])

Matches are checked with mrz_td1; one that fails it is dropped.

mrz_passport

Machine-readable zone (MRZ) of a passport, second line (ICAO TD3): 44 characters with the passport number, nationality, date of birth, sex and expiry date, of any country.

rre.mrz_passport(text)

(?<![A-Z0-9<])[A-Z0-9<]{9}\d[A-Z<]{3}\d{6}\d[MFX<]\d{6}\d[A-Z0-9<]{14}[\d<]\d(?![A-Z0-9<])

Matches are checked with mrz_td3; one that fails it is dropped.

Companies and tax

function checksum validator
rre.eori_number
rre.lei lei

eori_number

Customs EORI number (Economic Operators Registration and Identification) after EORI, keyword included in the match: the code of an EU country, GB or XI and up to 15 letters or digits, like EORI: NL123456789.

rre.eori_number(text)

\b(?i:eori)(?i:[ -]?(?:number|nummer|no|nr|n°|code))?\.?(?:\s?[:#]\s?|\s)(?:AT|B[EG]|C[YZ]|D[EK]|E[ELS]|F[IR]|G[BR]|H[RU]|I[ET]|L[TUV]|MT|NL|P[LT]|RO|S[EIK]|XI) ?(?=[A-Z0-9]{0,14}\d)[A-Z0-9]{1,15}\b

lei

Legal Entity Identifier (LEI, ISO 17442): 20 capital letters and digits with at least one letter, ending in two check digits, like 506700GE1G29325QX363.

rre.lei(text)

\b(?=\d{0,17}[A-Z])[A-Z\d]{18}\d{2}\b

Matches are checked with lei; one that fails it is dropped.

Banking and payments

function checksum validator
rre.card_dump card_pan
rre.card_track_data card_pan
rre.credit_card luhn
rre.currency_amount
rre.gift_card_code
rre.iban iban
rre.isin isin
rre.payconiq_link
rre.paypal_me_link
rre.revolut_link
rre.rf_creditor_reference iso11649
rre.sepa_creditor_id sepa_creditor_id

card_dump

Payment card dump line, as traded on carding forums: card number, expiry month and year and CVV separated by |, :, ; or /, with any further fields up to the end of the line.

rre.card_dump(text)

\b[2-6]\d{12,18} ?([|:;/]) ?(?:0?[1-9]|1[0-2]) ?(?:\1|/)? ?(?:20)?\d{2} ?\1 ?\d{3,4}\b(?: ?\1 ?(?!\d{13})[^|:;/\s]*(?: (?!\d{13})[^|:;/\s]+)*)*

Matches are checked with card_pan; one that fails it is dropped.

card_track_data

Magnetic stripe data of a payment card: track 1 (%B, card number, ^NAME^, expiry YYMM, ...) and track 2 (;, card number, =, expiry YYMM, ...), sentinels optional, also with EMV's D (and padding F).

rre.card_track_data(text)

(?:%B|\bB)\d{13,19}\^[^^\n]{2,26}\^\d{2}(?:0[1-9]|1[0-2])\d{3}[^?\s]*\??|;?\b\d{13,19}[=D]\d{2}(?:0[1-9]|1[0-2])\d{3}\d*F?\??(?!\w)

Matches are checked with card_pan; one that fails it is dropped.

credit_card

Payment card number (credit or debit card, PAN): 13 to 19 digits starting with 2 to 6 (13 only for Visa, 14 for Diners Club and 15 for American Express, starting with 4, 3 and 34 or 37), in one block or in groups of four (4-6-5 and 4-6-4 for American Express and Diners Club) split by spaces or dashes, but not within a longer row of digit groups, like 4111 1111 1111 1111.

rre.credit_card(text)

\b(?:(?!(?!4)\d{13}\b|(?!3)\d{14}\b|(?!3[47])\d{15}\b)[2-6]\d{12,18}|(?<!\d[ -])(?:[2-6]\d{3}([ -])\d{4}\1\d{4}\1(?:\d|\d{4}(?:\1\d{1,3})?)|3\d{3}([ -])\d{6}\2\d{4,5})(?![ -]\d{4}\b))\b

Matches are checked with luhn; one that fails it is dropped.

currency_amount

Amount of money with a currency symbol or code before or after it (€, $, £, EUR, USD, CHF, BTC, USDT, zł, lei, ...), like € 1.234,56, $1,234.56, CHF 1'234.50, 5k€ or € 50,-. A code is glued to the number only in capitals (EUR100, not eth0), and Euro before 1 to 7 or a year is an emission standard or a tournament (Euro 6, Euro 2024).

rre.currency_amount(text)

(?:[€$£¥₿₽₺₹]|\b(?:(?i:eur(?:os?(?!\s?(?:[1-7]|20\d\d)(?![.,]?\d)))?|usd[tc]?|dollars?|gbp|chf|pln|aed|btc|eth|xmr|ltc|xrp|trx)|TRY|MAD|RON|RUB))\s?(?<![a-z])(?:\d{1,3}(?:[.,' \u00a0\u202f]\d{3}){1,4}|\d+)(?:[.,]\d+)?(?:,-|[kK])?(?![\d.,]?\d)|(?<![\w.,])(?<!\d )(?:\d{1,3}(?:[.,' \u00a0\u202f]\d{3}){1,4}|\d+)(?:[.,]\d+)?(?:,-|[kK])?\s?(?:[€$£¥₿₽₺₹]|(?:(?i:eur(?:os?)?|usd[tc]?|dollars?|gbp|chf|pln|aed|btc|eth|xmr|ltc|xrp|trx)|TRY|MAD|RON|RUB|zł|lei)\b)

gift_card_code

Prepaid or gift card code after its brand, which is part of the match: paysafecard, Flexepin, Transcash, Neosurf, PCS, Apple/iTunes, Google Play, Steam or Amazon, each in its own code format (with at least one digit for Google Play, Steam and Amazon).

rre.gift_card_code(text)

\b(?i:(paysafe(?:card)?|psc|flexepin|transcash)|(neosurf|(?<!\d)(?<!\d )pcs)|(apple|itunes)|(google ?play)|steam|amazon)\b(?:\D|\d{1,3}\D){0,24}?\b(?(1)\d{4}(?:[ -]?\d{4}){2,3}(?![ -]?\d{4})|(?(2)(?=[A-Z -]{0,11}\d)(?=[\d -]{0,11}[A-Z])[A-Z\d]{4}[ -]?[A-Z\d]{3}[ -]?[A-Z\d]{3}|(?(3)X[A-Z\d]{15}|(?=[A-Z -]{0,17}\d)(?(4)[A-Z\d]{4}(?:[ -]?[A-Z\d]{4}){3,4}|[A-Z\d]{4,5}-[A-Z\d]{5,6}-[A-Z\d]{4,5}))))\b

iban

IBAN of any country that uses them, at that country's length: country code, two check digits and the account number, in capitals, in one block or groups of four, like GB29 NWBK 6016 1331 9268 19.

rre.iban(text)

\b[A-Z]{2}\d{2}(?: ?[A-Z0-9]{4}){2,7}(?: ?[A-Z0-9]{1,4})?\b

Matches are checked with iban (registry True); one that fails it is dropped.

isin

Securities identification number (ISIN) after ISIN or ISIN-code, keyword included in the match: two letters, nine letters or digits and a check digit, like ISIN US0378331005.

rre.isin(text)

\bISIN(?:[ -]?[Cc]ode)?(?:\s?:\s?|\s)[A-Z]{2}[A-Z\d]{9}\d\b

Matches are checked with isin; one that fails it is dropped.

Payconiq by Bancontact payment link or QR code content, on payconiq.com or pay.bancontact.net: a payment /pay/2/..., a till's static QR code /l/1/... or an invoice /t/1/...?A=....

rre.payconiq_link(text)

(?i)(?<![\w.-])(?:https?://)?(?:www\.)?(?:payconiq\.com|pay\.bancontact\.net)/(?:pay/[12]|[lt]/1)/(?P<id>[a-z\d]{1,64})(?:/[a-z\d]{1,36})?(?![\w-])(?:\?[^\s<>\"']*)?(?<![.,;:!?)\]])

PayPal.Me payment link: paypal.me/ or paypal.com/paypalme/, a name of up to 20 letters and digits and an optional amount and currency, like paypal.me/testuser or https://paypal.me/testuser/25EUR.

rre.paypal_me_link(text)

(?i)(?<![\w.-])(?:https?://)?(?:www\.)?(?:paypal\.me|paypal\.com/paypalme)/(?!(?:pools|my)\b)(?P<user>[a-z\d]{1,20})(?:/(?P<amount>\d+(?:[.,]\d{1,2})?(?:[a-z]{3})?))?(?![\w-])

Revolut payment link: revolut.me/ and a Revtag of 3 to 16 letters and digits, like revolut.me/testuser1, or a Revolut Business checkout link checkout.revolut.com/payment-link/....

rre.revolut_link(text)

(?i)(?<![\w.-])(?:https?://)?(?:www\.)?(?:revolut\.me/(?P<revtag>[a-z\d]{3,16})|checkout\.revolut\.com/payment-link/[\w-]{8,64})(?![\w-])

rf_creditor_reference

Structured creditor reference (RF reference, ISO 11649) on invoices and SEPA transfers: RF, two check digits and up to 21 letters or digits, in one block or groups of four, like RF18 5390 0754 7034.

rre.rf_creditor_reference(text)

\bRF\d\d(?:(?: ?[A-Z0-9]{4}){5} ?[A-Z0-9]|(?: ?[A-Z0-9]{4}){0,4} ?[A-Z0-9]{1,4})\b

Matches are checked with iso11649; one that fails it is dropped.

sepa_creditor_id

SEPA creditor identifier (Creditor ID, Gläubiger-ID, ICS) of a direct debit: country code, two check digits, the business code ZZZ and the national number, like DE98ZZZ09999999999.

rre.sepa_creditor_id(text)

\b[A-Z]{2}\d\d ?ZZZ ?[A-Z0-9]{1,4}(?: ?[A-Z0-9]{1,4}){0,6}\b

Matches are checked with sepa_creditor_id; one that fails it is dropped.

Crypto

function checksum validator
rre.bip39_seed_phrase bip39
rre.bitcoin_address crypto_address
rre.bitcoin_cash_address cashaddr
rre.bitcoin_extended_key base58check
rre.bitcoin_private_key base58check
rre.cardano_address cardano_address
rre.cosmos_address bech32
rre.dash_address dash_address
rre.dogecoin_address dogecoin_address
rre.ens_name
rre.ethereum_address
rre.ethereum_private_key
rre.ethereum_tx_hash
rre.lightning_invoice bech32
rre.litecoin_address crypto_address
rre.lnurl bech32
rre.monero_address
rre.nostr_key bech32
rre.polkadot_address ss58
rre.solana_address solana_address
rre.stellar_address stellar_strkey
rre.ton_address ton_address
rre.tron_address base58check
rre.xrp_address ripple_base58check
rre.zcash_address zcash_address

bip39_seed_phrase

Crypto wallet seed phrase (BIP39 recovery phrase, mnemonic): 12, 15, 18, 21 or 24 words of the English BIP39 list in a row, also numbered (1. word) or one per line.

rre.bip39_seed_phrase(text)

(?<![A-Za-z])[A-Za-z]{3,8}(?:(?:[\s\d.,;)"'-]|(?<=\d):)+[A-Za-z]{3,8}){11,}(?![A-Za-z])

Matches are checked with bip39; one that fails it is dropped.

bitcoin_address

Bitcoin (BTC) address: legacy and P2SH addresses starting with 1 or 3, and SegWit and Taproot addresses starting with bc1 (or BC1, as in QR codes), like 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa.

rre.bitcoin_address(text)

\b(?:(?i:bc1[ac-hj-np-z02-9]{39,59})|[13][1-9A-HJ-NP-Za-km-z]{25,34})\b

Matches are checked with crypto_address (versions [0, 5]); one that fails it is dropped.

bitcoin_cash_address

Bitcoin Cash (BCH) address in CashAddr form, with or without bitcoincash:: 42 characters starting with q or p (z or r if token-aware; 61 for P2SH32), like qr6m7j9njldwwzlg9v7v53unlr4jkmx6eylep8ekg2.

rre.bitcoin_cash_address(text)

\b(?i:(?:bitcoincash:)?(?:[qpzr][02-9ac-hj-np-z]{41}|[pr][02-9ac-hj-np-z]{60}))\b

Matches are checked with cashaddr; one that fails it is dropped.

bitcoin_extended_key

Bitcoin extended public or private key (BIP32): xpub, xprv, ypub, zpub, tpub or another SLIP-132 prefix, followed by 107 base58 characters, 111 in all.

rre.bitcoin_extended_key(text)

\b[xyztuvYZUV](?:pub|prv)[1-9A-HJ-NP-Za-km-z]{107}\b

Matches are checked with base58check; one that fails it is dropped.

bitcoin_private_key

Bitcoin private key in wallet import format (WIF): 51 base58 characters starting with 5, or 52 starting with K or L for a compressed key.

rre.bitcoin_private_key(text)

\b(?:5[1-9A-HJ-NP-Za-km-z]{50}|[KL][1-9A-HJ-NP-Za-km-z]{51})\b

Matches are checked with base58check (versions [128]); one that fails it is dropped.

cardano_address

Cardano (ADA) address: Shelley addresses starting with addr1, stake addresses with stake1, and legacy Byron addresses with Ae2 or DdzFF, like addr1vx2fxv2umyhttkxyxp8x0dlpdt3k6cwng5pxj3jhsydzers66hrl8.

rre.cardano_address(text)

\b(?:addr1[ac-hj-np-z02-9]{53,110}|stake1[ac-hj-np-z02-9]{53}|Ae2[1-9A-HJ-NP-Za-km-z]{55,56}|DdzFF[1-9A-HJ-NP-Za-km-z]{90,110})\b

Matches are checked with cardano_address; one that fails it is dropped.

cosmos_address

Cosmos (ATOM) address, or one of another Cosmos SDK chain such as Osmosis (osmo) or Injective (inj): the prefix, 1 and 38 bech32 characters (58 for a contract), like cosmos12wtuazg5tjtcutw29saqeeuu697xt48cgq3hmh.

rre.cosmos_address(text)

\b(?:cosmos|osmo|juno|akash|secret|terra|kava|cro|inj|evmos|celestia|dydx|sei|noble|neutron|stride|axelar|kujira|stars|thor)(?:valoper)?1[ac-hj-np-z02-9]{38}(?:[ac-hj-np-z02-9]{20})?\b

Matches are checked with bech32; one that fails it is dropped.

dash_address

Dash (DASH) address: 34 base58 characters starting with X, or with 7 for a P2SH address, like XgNSWgGvrWBeJpBKbJyDpRJL2q1DofCwz2.

rre.dash_address(text)

\b[X7][1-9A-HJ-NP-Za-km-z]{33}\b

Matches are checked with dash_address; one that fails it is dropped.

dogecoin_address

Dogecoin (DOGE) address: 34 base58 characters starting with D, or 9 or A for a P2SH address, like DD4KSSuBJqcjuTcvUg1CgUKeurPUFeEZkE; DigiByte addresses starting with D look the same.

rre.dogecoin_address(text)

\b[9AD][1-9A-HJ-NP-Za-km-z]{33}\b

Matches are checked with dogecoin_address; one that fails it is dropped.

ens_name

Ethereum Name Service (ENS) name: a name of three or more letters, digits or hyphens ending in .eth, with optional subdomains in front, like jane-example.eth or pay.jane-example.eth.

rre.ens_name(text)

(?<![\w.-])(?:[\w-]+\.)*[\w-]{3,}\.(?i:eth)(?![\w@-]|\.\w)

ethereum_address

Ethereum (ETH) address: 0x and 40 hexadecimal characters, lower, upper or mixed case; addresses on other EVM chains (BNB Smart Chain, Polygon, ...) look the same.

rre.ethereum_address(text)

\b0x[a-fA-F0-9]{40}\b

ethereum_private_key

Ethereum private key after private key, privkey or the label in Dutch, French, German, Spanish, Italian, Polish or Romanian, keyword included in the match: 64 hexadecimal characters, with or without 0x.

rre.ethereum_private_key(text)

(?i:(?:priv(?:ate)?[ _-]?key|priv[eé][ -]?sleutel|private sleutel|privat(?:er|en)? schl(?:ü|ue?)ssel|cl(?:é|e|ef) priv[eé]e|clave privada|chiave privata|klucz prywatny|chei[ae] privat[aă])[\W_]{1,10}(?:0x)?[0-9a-f]{64})\b

ethereum_tx_hash

Ethereum (ETH) transaction hash (tx hash, TxID): 0x and 64 hexadecimal characters, as on Etherscan; block hashes and other 32-byte values on Ethereum and other EVM chains look the same.

rre.ethereum_tx_hash(text)

\b0x[a-fA-F0-9]{64}\b

lightning_invoice

Lightning Network invoice (BOLT 11 payment request): lnbc, an optional amount like 2500u, 1 and a few hundred bech32 characters, in lower or upper case; lntb, lntbs and lnbcrt on the test networks.

rre.lightning_invoice(text)

\b(?i:ln(?:bc|tbs?|bcrt)\d{0,20}[munp]?1[ac-hj-np-z02-9]{170,4000})\b

Matches are checked with bech32; one that fails it is dropped.

litecoin_address

Litecoin (LTC) address: legacy addresses starting with L or M, and SegWit addresses starting with ltc1 (or LTC1), like LKDyUEtTR1HXamkiEphisSiBJu6o3ZPE34.

rre.litecoin_address(text)

\b(?:(?i:ltc1[ac-hj-np-z02-9]{39,59})|[LM][1-9A-HJ-NP-Za-km-z]{33})\b

Matches are checked with crypto_address (versions [48, 50]); one that fails it is dropped.

lnurl

LNURL (LUD-01): a bech32-encoded link to a Lightning payment, withdrawal or login, starting with LNURL1, in capitals as in QR codes or lower case, also after lightning: or ?lightning=.

rre.lnurl(text)

\b(?i:lnurl1[ac-hj-np-z02-9]{30,2000})\b

Matches are checked with bech32; one that fails it is dropped.

monero_address

Monero (XMR) standard address: 95 base58 characters, starting with 4 and then a digit, A or B.

rre.monero_address(text)

\b4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}\b

nostr_key

Nostr public key (npub), private key (nsec) or note ID (note) as in NIP-19: the prefix, 1 and 58 bech32 characters, like npub10elfcs4fr0l0r8af98jlmgdh9c8tcxjvz9qkw038js35mp4dma8qzvjptg.

rre.nostr_key(text)

\b(?i:(?:npub|nsec|note)1[ac-hj-np-z02-9]{58})\b

Matches are checked with bech32; one that fails it is dropped.

polkadot_address

Polkadot (DOT) address in SS58 format: 47 or 48 base58 characters starting with 1, or a Kusama (C to J) or generic Substrate (5) address, like 15oF4uVJwmo4TdGW7VfQxNLavjCXviqxT9S1MgbjMNHr6Sp5.

rre.polkadot_address(text)

\b[1C-HJ5][1-9A-HJ-NP-Za-km-z]{46,47}\b

Matches are checked with ss58; one that fails it is dropped.

solana_address

Solana (SOL) address after Solana, SOL, Solscan, Solflare or Phantom, keyword included in the match: 32 to 44 base58 characters, as in the payment link solana:1thX6LZfHDZZKUs92febYZhYRcXddmzfzF2NvTkPNE.

rre.solana_address(text)

\b(?i:solana|sol|solscan|solflare|phantom)\b[\s\S]{0,30}?\b[1-9A-HJ-NP-Za-km-z]{32,44}\b

Matches are checked with solana_address; one that fails it is dropped.

stellar_address

Stellar (XLM) account address: G followed by 55 base32 characters (A to Z, 2 to 7), or a muxed account of 69 starting with M, like GA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJVSGZ.

rre.stellar_address(text)

\b(?:G[A-D][A-Z2-7]{54}|M[A-D][A-Z2-7]{67})\b

Matches are checked with stellar_strkey; one that fails it is dropped.

ton_address

TON (Toncoin) address in the user-friendly form wallets show: 48 base64 or base64url characters starting with EQ (bounceable) or UQ (non-bounceable), like UQA1GzQQSS9TTcMzmQCxmmvcI-D8TB1VHRRSJbf1xiowooS-.

rre.ton_address(text)

(?<![A-Za-z0-9_+-])[EU]Q[A-D][A-Za-z0-9_+/-]{45}(?![A-Za-z0-9_+-])

Matches are checked with ton_address; one that fails it is dropped.

tron_address

Tron (TRX) address, also used for USDT on Tron (TRC-20): T followed by 33 base58 characters, like TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t.

rre.tron_address(text)

\bT[1-9A-HJ-NP-Za-km-z]{33}\b

Matches are checked with base58check (versions [65]); one that fails it is dropped.

xrp_address

XRP Ledger (Ripple) classic address: r followed by 24 to 34 characters of Ripple's base58 alphabet, like rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh.

rre.xrp_address(text)

\br[1-9A-HJ-NP-Za-km-z]{24,34}\b

Matches are checked with ripple_base58check; one that fails it is dropped.

zcash_address

Zcash (ZEC) address: transparent addresses of 35 base58 characters starting with t1 or t3, shielded Sapling addresses starting with zs1 and unified addresses with u1, like t1gzrYQxjzxY84DdGQA47sHB3vHrKCxtkqa.

rre.zcash_address(text)

\b(?:t[13][1-9A-HJ-NP-Za-km-z]{33}|zs1[ac-hj-np-z02-9]{75}|u1[ac-hj-np-z02-9]{100,400})\b

Matches are checked with zcash_address; one that fails it is dropped.

Phones and SIM cards

function checksum validator
rre.esim_eid eid
rre.esn
rre.iccid luhn
rre.imei luhn
rre.imeisv
rre.mcc_mnc mcc_mnc
rre.meid meid
rre.phone_e164 phone
rre.tel_uri
rre.ussd_code

esim_eid

eSIM EID (eUICC identifier): 32 digits starting with 89, in one block or groups of four, after EID or eUICC ID, keyword included in the match, like EID: 89049032123451234512345678901235.

rre.esim_eid(text)

["']?\b(?i:eid|euicc(?:[ _-]?id)?)["']?\s?[:=#]?\s?["']?89\d\d(?: ?\d{4}){7}(?!\d)["']?

Matches are checked with eid; one that fails it is dropped.

esn

CDMA phone electronic serial number (ESN, or pseudo-ESN) after ESN or pESN, keyword included in the match: 8 hexadecimal digits like ESN: 80ABCDEF, or 11 decimal digits, a manufacturer code up to 255 and a serial number up to 16777215.

rre.esn(text)

\b(?i:p?esn(?:[\s_]?\(?(?:hex|dec)\)?)?)\W{1,4}(?P<esn>[0-9A-Fa-f]{8}|(?:25[0-5]|2[0-4]\d|[01]\d\d) ?(?:0\d{7}|1(?:[0-5]\d{6}|6(?:[0-6]\d{5}|7(?:[0-6]\d{4}|7(?:[0-6]\d{3}|7(?:[01]\d\d|2(?:0\d|1[0-5]))))))))\b

iccid

SIM card number (ICCID, the serial printed on the SIM): 89 followed by 16 to 18 digits, 18 to 20 in all, without spaces, like 893201123456789010.

rre.iccid(text)

\b89\d{16,18}\b

Matches are checked with luhn; one that fails it is dropped.

imei

Phone serial number (IMEI): 15 digits in a row, without spaces or dashes, like 490154203237518.

rre.imei(text)

\b\d{15}\b

Matches are checked with luhn; one that fails it is dropped.

imeisv

Phone serial number with software version (IMEISV) after IMEISV or IMEI SV, keyword included in the match: the IMEI without its check digit and a 2-digit version, 16 digits, like IMEISV: 4901542032375181.

rre.imeisv(text)

\b(?i:imei[ /-]?svn?)\W{1,4}(?P<tac>\d{2}[ -]?\d{6})[ -]?(?P<snr>\d{6})[ -]?(?P<svn>\d{2})\b

mcc_mnc

Mobile network code (MCC-MNC, PLMN): country and network code after MCC and MNC, PLMN, HNI or operator.numeric, keyword included in the match, like MCC 206 MNC 01, PLMN: 20601 or mnc001.mcc206.

rre.mcc_mnc(text)

(?i)\b(?:m?mcc\W{0,4}\d{3}\W{1,4}m?mnc\W{0,4}\d{1,3}|(?:mcc[ /_-]?mnc|e?[hrv]?plmn(?:[ _-]?id)?|hni|operator[._ ]numeric)\W{1,4}\d{3}[ /-]?\d{2,3}|mnc\d{3}\.mcc\d{3})\b

Matches are checked with mcc_mnc; one that fails it is dropped.

meid

CDMA phone serial number (MEID) after MEID, MEID HEX or MEID DEC, keyword included in the match: 14 hexadecimal digits with an optional check digit, like MEID: A10000009296F2, or the 18-digit decimal form.

rre.meid(text)

\b(?i:meid(?:[\s_]?\(?(?:hex|dec)\)?)?)\W{1,4}(?P<meid>\d{5} ?\d{5} ?\d{4} ?\d{4}(?: ?\d)?|[0-9A-Fa-f]{2}(?: ?[0-9A-Fa-f]{2}){6}(?: ?[0-9A-Fa-f])?)\b

Matches are checked with meid; one that fails it is dropped.

phone_e164

Phone number in international E.164 form: +, the country code and the number without spaces, 7 to 15 digits, like +32470123456; only numbers valid in their country.

rre.phone_e164(text)

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

Matches are checked with phone; one that fails it is dropped.

tel_uri

Phone link (tel:, sms:, smsto:, mms: or mmsto: URI) with its number, parameters and message body, like tel:+32470123456, tel:+1-201-555-0123;ext=1234 or sms:+32470123456?body=Hi.

rre.tel_uri(text)

\b(?:tel|sms|smsto|mms|mmsto):(?://)?(?P<number>\+?\(?\d{1,15}(?:[-.()]{1,2}\d{1,15}){0,10})(?! ?\d)(?:,\+?\(?\d{1,15}(?:[-.()]{1,2}\d{1,15}){0,10}(?! ?\d)){0,9}(?:;[\w-]{1,32}(?:=[\w%+-]{1,64}(?:\.[\w%+-]{1,64}){0,10})?){0,5}(?:[?&][^\s<>"']*(?<![.,;:!?)\]]))?

ussd_code

USSD or MMI code as dialled on a phone: digits and stars between a leading * or # and the closing #, like *#06#, *100#, *139*1*1234567890#, ##002# or *#*#4636#*#*.

rre.ussd_code(text)

(?<![\w*#])(?:\*#\*#\d{1,8}#\*#\*|(?:\*[*#]?|##)\d{1,4}(?:\*\+?\d{0,20}){0,6}#|#\d{2,3}(?:\*\+?\d{0,20}){0,6}#)(?![*#])

Messaging and social media

function checksum validator
rre.automated_message_text
rre.bluesky_handle
rre.discord_invite
rre.discord_user_id
rre.drug_emoji
rre.email
rre.hashtag
rre.machine_sender
rre.mastodon_handle
rre.matrix_id
rre.mention
rre.reddit_user
rre.signal_link
rre.simplex_link
rre.sip_uri
rre.skype_id
rre.social_media_profile
rre.telegram_link
rre.threema_link
rre.tox_id tox_id
rre.unsubscribe_text
rre.url_shortener_link
rre.verification_code_message
rre.whatsapp_jid
rre.whatsapp_link

automated_message_text

Wording that marks an automated email: automated message, automatically generated, autogenerated, please do not reply, automatisch gegenereerd, message automatique, généré automatiquement, ne pas répondre, automatisch generiert, bitte nicht antworten.

rre.automated_message_text(text)

(?i)\b(?:automated (?:message|e-?mail)|auto(?:matically |-)?(?:generated|sent)|please do not reply|do not reply to this|automatisch\w* (?:ge(?:genereerd|neriert)|ver(?:zonden|stuurd|s[ae]nd)|(?:be|nach)richt|er(?:stellt|zeugt))|(?:message|e-?mail|courriel)s? automatique|(?:g[ée]n[ée]r|envoy|cr[ée]|exp[ée]di)[ée]e?s? automatiquement|ne pas (?:y )?r[ée]pondre|niet te (?:be)?antwoorden|bitte nicht (?:be)?antworten|antworten sie nicht)

bluesky_handle

Bluesky handle: a name under bsky.social, like @jane.bsky.social, or a custom domain or did: ID in a bsky.app/profile/ link or after Bluesky or bsky, keyword included in the match.

rre.bluesky_handle(text)

(?<![\w.@/-])(?:(?:(?i:(?:https?://)?(?:www\.)?bsky\.app/profile/)|(?i:bluesky|bsky)(?:[ _-]?(?i:handle|account|profile|id))?(?:\s?[:=]\s?|\s)@?)(?:did:plc:[a-z2-7]{24}|(?:did:web:)?(?:[A-Za-z0-9-]{1,63}\.){1,10}[A-Za-z]{2,63})|@?[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.bsky\.social)(?![\w-]|\.[A-Za-z0-9])

discord_invite

Discord invite link: discord.gg/ or discord.com/invite/ (also discordapp.com) and the invite code, with or without https://, like https://discord.gg/abc123.

rre.discord_invite(text)

(?<![\w.-])(?i:(?:https?://)?(?:www\.)?(?:discord\.gg|discord(?:app)?\.com/invite))/[\w-]+

discord_user_id

Discord user ID (a 17- to 19-digit snowflake) in a mention like <@412345678901234567>, a discord.com/users/ link, or after Discord ID, keyword included in the match.

rre.discord_user_id(text)

<@!?\d{17,19}>|(?<![\w.-])(?:(?i:(?:https?://)?(?:(?:ptb|canary)\.)?discord(?:app)?\.com/users/)|(?i:discord[ _-]?(?:(?:user|account)[ _-]?)?(?:id)?)["']?\s?[:=]?\s?["']?)\d{17,19}(?!\d)

drug_emoji

Emoji used as drug codes: snowflake, snowmen, 8-ball, pill, syringe, maple leaf, plug and mushroom, each with its emoji variation selector (U+FE0F) when there is one.

rre.drug_emoji(text)

[❄⛄☃🎱💊💉🍁🔌🍄]\ufe0f?

email

Email address: a user name of letters, digits, dots, underscores, plus signs and hyphens, @ and a domain ending in a top-level domain of two or more letters, like jan.peeters+x@test.be; fediverse handles (@jane@mastodon.example) and WhatsApp IDs (...@s.whatsapp.net) do not match.

rre.email(text)

(?<![\w.+@-])[\w.+-]+@(?!(?:s\.whatsapp\.net|[cg]\.us)(?![\w.-]))(?:[^\W_]|-)+(?:\.(?:[^\W_]|-)+)*\.[A-Za-z]{2,}(?![\w-])

hashtag

Hashtag: # and a word of letters, digits and underscores with at least one letter, like #coke; #420, a # inside a word or after a slash, and hex colors like #1A2B3C do not match.

rre.hashtag(text)

(?<![\w#&/])#(?!(?=[A-Fa-f]*\d)[0-9A-Fa-f]{6}(?:[0-9A-Fa-f]{2})?(?!\w))\d*[^\W\d]\w*

machine_sender

Email address of an automated sender, by its user name: noreply, no-reply, do-not-reply, ne-pas-repondre, niet-beantwoorden, newsletter, nieuwsbrief, marketing, notifications, alerts, mailer-daemon, postmaster, bounces.

rre.machine_sender(text)

(?i)(?<![\w.+=-])(?P<local>(?:[^\W_]+[._+=-]){0,8}?(?:no[._-]?reply|do[._-]?not[._-]?reply|ne[._-]?pas[._-]?r[ée]pondre|niet[._-]?(?:be)?antwoorden|nicht[._-]?antworten|newsletters?|nieuwsbrief|marketing|notifications?|alerts?|mailer(?:[._-]?daemon)?|postmaster|bounces?)\d*(?:[._+=-][^\W_]+){0,8})@[\w-]+(?:\.[\w-]+)*\.[A-Za-z]{2,}

mastodon_handle

Mastodon or other fediverse handle: @, the user name, @ and the server's domain, like @jane@mastodon.example; addresses at common mail providers (Gmail, Outlook, ...) do not match.

rre.mastodon_handle(text)

(?<![\w@./=+-])@[A-Za-z0-9_](?:[A-Za-z0-9_.-]{0,62}[A-Za-z0-9_])?@(?!(?:g(?:oogle)?mail|hotmail|outlook|live|msn|yahoo|icloud|aol|gmx|proton(?:mail)?)\.)(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.){1,10}[A-Za-z]{2,63}(?![\w-]|\.[A-Za-z0-9])

matrix_id

Matrix (Element) user ID: @, the user name, a colon and the server's domain with an optional port, like @alice:example.org, also inside matrix.to links; email addresses do not match.

rre.matrix_id(text)

(?<![\w.+-])@[a-zA-Z0-9._=/+-]+:(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?![\w-])

mention

@-mention of a user name, as on X, Instagram or Telegram: @ and three or more letters, digits or underscores, also with dots between them, like @dealer123 or @jane.doe; email addresses, fediverse handles and links like example.com/@jane do not match.

rre.mention(text)

(?<![\w@/])@\w{3,}(?:\.\w+)*(?![\w@]|\.\w)

reddit_user

Reddit user name (3 to 20 letters, digits, - or _) as u/name or /u/name, or in a reddit.com/user/ or reddit.com/u/ link, like u/jane_example.

rre.reddit_user(text)

(?<![\w/.-])(?:(?i:(?:https?://)?(?:[a-z]{1,3}\.)?reddit\.com/u(?:ser)?/)|(?<!\d )/?u/)[A-Za-z0-9_-]{3,20}(?![\w-])

Signal link (https or sgnl://): a phone number link signal.me/#p/+..., a username link signal.me/#eu/..., a group invite signal.group/#... or a call link signal.link/call/#key=....

rre.signal_link(text)

(?<![\w.-])(?:(?:https?|sgnl)://)?(?:signal\.me/?#(?:p/\+?\d{7,15}|eu/[\w-]{20,})|signal\.group/?#[\w-]{20,}|signal\.link/call/?#key=[\w-]+)(?![\w-])

SimpleX Chat link: a contact address, one-time invitation or group link, long (simplex.chat/contact#/?v=...&smp=...) or short (https://smp4.simplex.im/a#...), also as simplex:/.

rre.simplex_link(text)

(?<![\w.-])(?:(?i:https?://)?[\w.-]{1,253}(?::\d{1,5})?|simplex:)/(?:(?:contact|invitation)#/\?v=[\d-]{1,10}&smp=[^\s<>"']{1,8000}(?<![.,;:!?)\]])|(?:[acgr]#|i#[A-Za-z0-9_-]{32}/)[A-Za-z0-9_-]{43}=?(?:\?h=[\w.,:%&=-]{1,2000}(?<![.,:&]))?(?![\w-]))

sip_uri

SIP address of a VoIP account or call (sip: or sips:): user, optional password, host or IP address and port, with parameters, like sip:alice@example.com or sip:+32470123456@sip.example.com;user=phone.

rre.sip_uri(text)

\b(?i:sips?):(?:(?P<user>[\w.!~*&=+$,%-]{1,64})(?::[\w.!~*&=+$,%-]{0,64})?@)?(?(user)|(?=\[|[a-zA-Z\d-]{1,63}\.[a-zA-Z\d]))(?P<host>\[[\dA-Fa-f:.]{2,45}\]|[a-zA-Z\d-]{1,63}(?:\.[a-zA-Z\d-]{1,63}){0,10})(?::\d{1,5})?(?:;[\w.!~*%+$&=:-]{1,64}){0,20}(?:\?[\w.!~*%+$&=:@-]{1,500})?(?<![.,;:!?~*])

skype_id

Skype or Teams account ID: a Microsoft account's live: name or live:.cid. ID, also after the 8: of newer Skype databases, a classic Skype name after 8: or a Teams 8:orgid: ID, like live:.cid.1a2b3c4d5e6f7a8b.

rre.skype_id(text)

(?<![\w:.+-])(?:(?:8:)?live:(?:\.cid\.[0-9a-f]{8,16}|(?=[\w.-]{0,63}[A-Za-z])[A-Za-z\d][\w.-]{0,62}[A-Za-z\d_])|8:(?:orgid:[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}|[a-z][a-z\d.,_-]{4,30}[a-z\d_-]))(?![\w@:-]|[.,]\w)

social_media_profile

Profile link on Instagram, Facebook (also profile.php?id=), X/Twitter, TikTok, Snapchat, YouTube or LinkedIn; links to posts, videos, shares and the sites' own pages do not match.

rre.social_media_profile(text)

(?i)(?<![\w.-])(?:https?://)?(?:[a-z]{1,3}\.)?(?:facebook\.com/profile\.php\?id=\d+|(?:instagram|facebook|twitter|x)\.com/(?!(?:photo|watch|reels|marketplace|search|home|explore|login|share|notifications|messages|friends|\w+\.php)\b)[\w.]+|(?:(?:tiktok|snapchat|youtube)\.com/@|youtube\.com/(?:channel|c|user)/|snapchat\.com/add/|linkedin\.com/(?:in|company)/)[\w.%-]{2,})(?<![.-])/?(?![\w/%-]|\.\w)

Telegram link: t.me/ or telegram.me/ and a username, channel (also its web preview s/) or invite (joinchat/ or +), with or without https://, like t.me/joinchat/AbCdEf or t.me/s/somechannel.

rre.telegram_link(text)

(?<![\w.-])(?i:(?:https?://)?(?:t|telegram)\.me)/(?:joinchat/|s/|\+)?[\w-]{3,}

Threema contact link: threema.id/ and an 8-character Threema ID (gateway IDs start with *), like https://threema.id/ECHOECHO, without the ?text= part.

rre.threema_link(text)

(?<![\w.-])(?:https?://)?threema\.id/[A-Z0-9*][A-Z0-9]{7}(?![\w-])

tox_id

Tox messenger ID, as left in ransomware notes: 76 hexadecimal characters (a public key, a nospam value and a checksum), in capitals or lower case, also after tox:.

rre.tox_id(text)

(?<![\w-])(?:[0-9A-F]{76}|[0-9a-f]{76})(?![\w-])

Matches are checked with tox_id; one that fails it is dropped.

unsubscribe_text

Unsubscribe wording of bulk mail and newsletters in English, Dutch, French or German: unsubscribe, opt-out, uitschrijven, afmelden, meld je af, désabonner, désinscrire, abmelden, abbestellen.

rre.unsubscribe_text(text)

(?i)\b(?:unsubscrib\w*|opt[- ]?out|uitschrij[fv]\w*|afmeld\w*|(?:schrijf|meld) (?:je|u) (?:hier )?(?:uit|af)|d[ée]s(?:abonn|inscri)\w*|ab(?:meld|bestell)\w*)\b

Short link of a URL shortener (bit.ly, t.co, tinyurl.com, is.gd, ow.ly, goo.gl, cutt.ly, rebrand.ly, shorturl.at, rb.gy and others) and its code, like bit.ly/3AbCdEf.

rre.url_shortener_link(text)

(?i)(?<![\w.@-])(?:https?://)?(?:www\.)?(?:bit\.(?:ly|do)|j\.mp|t\.(?:co|ly)|tinyurl\.com|tiny\.cc|(?:is|[vx])\.gd|ow\.ly|goo\.gl|cutt\.ly|rebrand\.ly|shorturl\.at|rb\.gy|buff\.ly|lnkd\.in|s\.id|clck\.ru|short\.gy)/(?!maps[/?])[a-z0-9_-]{3,64}(?![\w-])

verification_code_message

Verification code in a text message (2FA, OTP, login code) with its wording, which is part of the match, in English, Dutch, French or German, like Your WhatsApp code: 123-456 or 123456 is your Google code.

rre.verification_code_message(text)

(?i)(?:(\b(?:(?:verif|secur|beveil|sicherh|confirm|bevest|best[äa]e?tig|(?:log|sign)-?in|inlog|a?anmeld|authenti|one-time|e[ei]nmal|telegram|snapchat)\w*[ -]?(?:code|pass\w*)|otp\b|(?:your|je|jouw|uw|votre|dein|ihr)(?: (?-i:[A-Z])[\w.]*){0,2}[ -](?:code|otp)\b))\D{0,30}?)?\b(?P<code>\d{4,8}|\d{3}[- ]\d{3})\b(?![-.,]\d)(?(1)| (?:is|est|ist) (?:your|je|uw|votre|dein|ihr) \D{0,30}?(?:code|otp))

whatsapp_jid

WhatsApp JID, the account ID in WhatsApp's databases: a phone number in international form without + and @s.whatsapp.net (@c.us on the web), a group @g.us or a hidden user @lid, like 32470123456@s.whatsapp.net.

rre.whatsapp_jid(text)

(?<![\w.+-])(?:(?P<phone>[1-9]\d{5,14})(?:(?:(?:\.\d{1,3})?:\d{1,3})?@(?:s\.whatsapp\.net|c\.us)|-\d{10}@g\.us)|\d{6,20}(?::\d{1,3})?@(?:g\.us|lid|hosted(?:\.lid)?|newsletter|broadcast)|status@broadcast)(?![\w-])

WhatsApp link: a click-to-chat wa.me/ link with a phone number of 6 to 15 digits, with or without +, or a chat.whatsapp.com group invite, like wa.me/32470123456 or wa.me/+32470123456.

rre.whatsapp_link(text)

(?<![\w.-])(?i:(?:https?://)?(?:wa\.me/\+?\d{6,15}(?!\d)|chat\.whatsapp\.com/\w{10,}))

Web and network

function checksum validator
rre.asn asn
rre.cidr_range cidr
rre.file_share_link
rre.ip_address
rre.ipv6 ipv6
rre.mac_address mac_address
rre.magnet_link
rre.onion_address
rre.search_query_url
rre.url
rre.user_agent

asn

Autonomous system number (ASN) of a network, as in whois and IP lookups: AS or ASN and the number, keyword included in the match, like AS64496, ASN 64497 or "asn": 64500; AS400, AS2, the AS9100 standard and ASN.1 do not match.

rre.asn(text)

(?:\bAS(?!(?:400|9100|9110|9120)\b)(?=[1-9]\d\d)|\bASN(?:[ :#]{1,2}|(?=[1-9]\d))|["']?\b(?i:asn|autonomous[ _]system[ _]number)["']?\s?[:=]\s?(["'])?(?:AS)?)[1-9]\d{0,9}\b(?!\.\d)(?(1)\1?)

Matches are checked with asn; one that fails it is dropped.

cidr_range

IP network in CIDR notation: an IPv4 or IPv6 address and its prefix length (up to /32 or /128), like 10.0.0.0/8, 192.168.1.10/24 (an interface's address) or 2001:db8::/32.

rre.cidr_range(text)

(?<![\w./])(?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)/(?:3[0-2]|[12]?\d)|(?:[0-9A-Fa-f]{0,4}:){2,7}[0-9A-Fa-f]{0,4}/(?:12[0-8]|1[01]\d|[1-9]?\d))(?![\w/]|\.\d)

Matches are checked with cidr; one that fails it is dropped.

File-sharing link: MEGA (with its key), WeTransfer, Dropbox, Google Drive and Docs, OneDrive (1drv.ms), Gofile, Pixeldrain, Privnote, Pastebin, MediaFire, SwissTransfer, Wormhole, Proton Drive or Catbox.

rre.file_share_link(text)

(?i)(?<![\w.-])(?:https?://)?(?:[\w-]+\.)?(?:mega(?:\.co)?\.nz/(?:file/|folder/|#F?!)|we\.tl/|wetransfer\.com/downloads/|dropbox\.com/(?:s|sh|scl|t)/|db\.tt/|(?:drive|docs)\.google\.com/|1drv\.ms/|gofile\.io/d/|pixeldrain\.com/[lu]/|privnote\.com/|pastebin\.com/|mediafire\.com/|swisstransfer\.com/d/|wormhole\.app/|drive\.proton\.me/urls/|files\.catbox\.moe/)[^\s<>"']+(?<![.,;:!?)\]])

ip_address

IPv4 address: four numbers from 0 to 255 separated by dots, like 192.168.1.10 or 10.0.0.1; not part of a longer dotted number such as the version 1.2.3.4.5, nor a browser version like Chrome/120.0.0.0.

rre.ip_address(text)

\b(?<!\d\.)(?!(?<=[A-Za-z]/)\d{1,3}\.0\.0\.0\b)(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b(?!\.\d)

ipv6

IPv6 address, full or shortened with ::, like 2001:db8::1, fe80::1ff:fe23:4567:890a or ::ffff:192.0.2.1; only valid addresses, so times, MAC addresses and a bare :: do not match.

rre.ipv6(text)

(?<![\w:])(?=:*[0-9A-Fa-f])(?:[0-9A-Fa-f]{0,4}:){2,7}(?:(?:\d{1,3}\.){3}\d{1,3}|[0-9A-Fa-f]{0,4})(?![\w:]|\.\d)

Matches are checked with ipv6; one that fails it is dropped.

mac_address

MAC address (hardware, Wi-Fi or Bluetooth address, BSSID): six pairs of hexadecimal digits separated by colons or hyphens, like 00:1A:2B:3C:4D:5E; placeholders like 02:00:00:00:00:00, mixed separators and longer runs of pairs (key fingerprints) do not match.

rre.mac_address(text)

(?<!\b[0-9A-Fa-f]{2}[:-])\b[0-9A-Fa-f]{2}([:-])(?:[0-9A-Fa-f]{2}\1){4}[0-9A-Fa-f]{2}\b(?![:-][0-9A-Fa-f]{2}\b)

Matches are checked with mac_address; one that fails it is dropped.

BitTorrent magnet link with a v1 info hash (40 hex or 32 base32 characters) or a v2 one (btmh), with the parameters after it such as dn and tr.

rre.magnet_link(text)

\bmagnet:\?xt=urn:bt(?:ih:(?:[0-9a-fA-F]{40}|[A-Za-z2-7]{32})|mh:1220[0-9a-fA-F]{64})\b(?:&[^\s<>"']*)?(?<![.,;:!?)\]])

onion_address

Tor hidden service address (.onion): 56 characters for v3, ending in its version (d), or 16 for the old v2, of lowercase a-z and 2-7, followed by .onion.

rre.onion_address(text)

\b(?:[a-z2-7]{16}|[a-z2-7]{54}[aiqy]d)\.onion\b

search_query_url

Search results link holding what was searched for: Google, Bing, DuckDuckGo, YouTube (results?search_query=), Yahoo, Ecosia, Qwant, Startpage, Brave, Yandex or Baidu, like https://www.google.com/search?q=test+query.

rre.search_query_url(text)

(?i)(?<![\w.-])(?:https?://)?(?:\w+\.){0,2}(?:google\.(?:com?\.)?[a-z]{2,3}/(?:search)?|(?:duckduckgo|qwant)\.com/(?:\w+/?)?|(?:bing\.com|yandex\.[a-z]{2,3}|startpage\.com)/(?:\w+/)?\w*search/?|(?:ecosia\.org|brave\.com)/\w+|youtube\.com/results|baidu\.com/s|(yahoo\.com/search))(?:[?#&;][^\s?#&;]*){0,20}?[?#&;](?(1)p|(?:q|query|search_query|text|w(?:or)?d))=(?P<query>[^\s&#<>\"']+)(?<![.,;:!?)])

url

Web address or domain name like politie.be, my-site.com or http://www.test.be: the scheme and host, without the path; numbers like 249.99 or 12.03.2024, names like J.Peeters, email addresses, file names like DSC01234.JPG and app names like com.example.app do not match.

rre.url(text)

(?:(?i:https?://)|(?<![\w@])(?<!\w[.-])(?<!///))(?!(?i:com|org)\.)(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+(?!(?i:jpe?g|png|gif|hei[cf]|webp|bmp|tiff?|svg|aae|pdf|docx?|xlsx?|pptx?|txt|csv|log|xml|json|html?|php|js|css|exe|dll|apk|ipa|plist|db|sqlite(?:db)?|dat|bin|tmp|gz|rar|wav|ogg|opus|amr|avi|mkv|vcf|eml|eth|raf|cr[23]|nef|arw|dng|orf|rw2|mp[34]|m4[av]|3gp|aac|mpe?g)(?![A-Za-z0-9]))(?:[a-z]{2,}|[A-Z]{2,})(?!\.?[A-Za-z0-9])(?![\w.+-]{0,64}@)

user_agent

Browser user agent of the Mozilla/5.0 family, as in web server logs and User-Agent headers: the platform in brackets and the product tokens after it, like Mozilla/5.0 (X11; Linux x86_64) Gecko/20100101 Firefox/121.0.

rre.user_agent(text)

\bMozilla/[45]\.0 \([^()\r\n"]{1,300}\)(?: (?:[A-Za-z][\w.!+-]{0,40}/\d[\w+-]{0,19}(?:\.[\w+-]{1,20}){0,8}|Mobile\b|\([^()\r\n"]{1,200}\))){0,30}

Keys, passwords and hashes

function checksum validator
rre.api_key
rre.aws_secret_access_key
rre.azure_connection_string
rre.basic_auth_url
rre.bitlocker_recovery_key bitlocker_recovery_key
rre.database_connection_uri
rre.discord_webhook_url
rre.filevault_recovery_key
rre.jwt jwt
rre.md5
rre.otpauth_uri
rre.password
rre.password_hash
rre.pgp_block
rre.pgp_fingerprint
rre.private_key_block
rre.session_id
rre.sha1
rre.sha256
rre.sha512
rre.slack_webhook_url
rre.ssh_fingerprint
rre.ssh_public_key
rre.wifi_qr_string
rre.windows_product_key

api_key

API key or token with a known prefix: AWS, Google, GitHub, GitLab, Slack, Stripe live, OpenAI, Anthropic, SendGrid, npm, Hugging Face and DigitalOcean keys, and Telegram bot tokens, also inside a bot URL.

rre.api_key(text)

(?:(?<![\w-])|(?<=/bot))(?:A(?:KIA|SIA)[A-Z2-7]{16}|AIza[\w-]{35}|gh[oprsu]_[A-Za-z0-9]{36,}|github_pat_\w{82}|glpat-[\w-]{20,}(?:\.[0-9a-z]{9})?|xox[abeoprs]-\d+-[\w-]{10,}|[rs]k_live_[A-Za-z0-9]{20,}|sk-[\w-]{20,}T3BlbkFJ[\w-]{20,}|sk-ant-[a-z]+\d\d-[\w-]{80,}|SG\.[\w-]{22}\.[\w-]{43}|npm_[A-Za-z0-9]{36}|hf_[A-Za-z]{34}|do[opr]_v1_[a-f0-9]{64}|\d{5,16}:A[\w-]{34})(?![\w-])

aws_secret_access_key

AWS secret access key, 40 base64 characters after aws_secret_access_key, SecretAccessKey, secret access key or the access key ID, keyword included, like AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY.

rre.aws_secret_access_key(text)

(?:(?i:(?<![A-Za-z0-9])(?:aws[_ .-]?)?secret[_ .-]?access[_ .-]?key|(?<![A-Za-z0-9])aws[_ .-]?secret[_ .-]?key)[\s"'`:=>]{1,6}|\bA(?:KIA|SIA)[A-Z2-7]{16}[,;\s]{1,3})[A-Za-z0-9/+]{40}(?![\w/+=])

azure_connection_string

Azure connection string with its secret: a storage account's AccountKey=..., a Service Bus, Event Hubs or IoT Hub SharedAccessKey=... or a SharedAccessSignature, with the Name=value; pairs around it.

rre.azure_connection_string(text)

(?<![\w;.-])(?:[A-Z][A-Za-z]{1,39}=[^;\s"'<>=]{1,300};){0,12}?(?:(?:AccountKey|SharedAccessKey)=[A-Za-z0-9+/]{20,100}={0,2}(?![^;\s"'<>])|SharedAccessSignature[= ](?:[^;\s"'<>&]{1,300}&){0,20}?sig=[\w%+/=-]{10,200}(?:&[^;\s"'<>&]{1,300}){0,20})(?:;[A-Z][A-Za-z]{1,39}=[^;\s"'<>=]{1,300}){0,12};?

basic_auth_url

URL with a user name and password before the host, for any scheme (web, FTP, proxies, RTSP cameras), like https://jane:s3cret@example.com; a masked password does not match, database URIs are database_connection_uri.

rre.basic_auth_url(text)

(?<![\w+.-])(?!(?:postgres(?:ql)?|mysql|mariadb|mongodb|rediss?|mssql|sqlserver|oracle|couchdb|cockroachdb|clickhouse|neo4j)(?:\+[a-z0-9]{1,20})?://)[A-Za-z][A-Za-z0-9+.-]{1,20}://[^\s:/?#@"'<>]{0,100}:(?!\*{1,200}@)[^\s/?#"'<>]{1,200}@(?:[\w-]{1,63}(?:\.[\w-]{1,63}){0,10}|\[[0-9A-Fa-f:.]{2,45}\])(?::\d{1,5})?(?:[/?#][^\s"'<>]{0,500})?(?<![.,;:!?)\]])

bitlocker_recovery_key

BitLocker recovery key (recovery password): 48 digits in eight blocks of six, separated by dashes or spaces, like 123453-440000-720885-013574-333333-000055-244442-659989.

rre.bitlocker_recovery_key(text)

(?<![\w-])\d{6}([- ])\d{6}(?:\1\d{6}){6}(?![\w-])

Matches are checked with bitlocker_recovery_key; one that fails it is dropped.

database_connection_uri

Database connection URI with a user name and password: PostgreSQL, MySQL, MariaDB, MongoDB (also mongodb+srv), Redis, SQL Server, Oracle, ..., also with a driver, like postgres://jane:s3cret@db.example.com/app.

rre.database_connection_uri(text)

\b(?:postgres(?:ql)?|mysql|mariadb|mongodb|rediss?|mssql|sqlserver|oracle|couchdb|cockroachdb|clickhouse|neo4j)(?:\+[a-z0-9]{1,20})?://[^\s:/?#@"'<>]{0,100}:(?!\*{1,200}@)[^\s/?#"'<>]{1,200}@(?:[\w-]{1,63}(?:\.[\w-]{1,63}){0,10}|\[[0-9A-Fa-f:.]{2,45}\])(?::\d{1,5})?(?:,(?:[\w-]{1,63}(?:\.[\w-]{1,63}){0,10}|\[[0-9A-Fa-f:.]{2,45}\])(?::\d{1,5})?){0,10}(?:[/?][^\s"'<>]{0,500})?(?<![.,;:!?)\]])

discord_webhook_url

Discord webhook URL: discord.com/api/webhooks/ (also discordapp.com, ptb., canary., an API version), the webhook ID and its token; anyone holding it can post, malware uses it to send stolen data.

rre.discord_webhook_url(text)

(?i)(?<![\w.-])(?:https?://)?(?:(?:ptb|canary)\.)?discord(?:app)?\.com/api/(?:v\d{1,2}/)?webhooks/\d{17,20}/[\w-]{60,80}(?![\w-])

filevault_recovery_key

FileVault personal recovery key after FileVault, recovery key, herstelsleutel, clé de secours, ..., keyword included: six groups of four capitals or digits, like Recovery Key: AB12-CD34-EF56-GH78-JK9L-MN0P.

rre.filevault_recovery_key(text)

(?i:\bFileVault(?:[ -]?(?:personal[ -])?recovery)?(?:[ -]?key)?|\b(?:personal[ -])?recovery[ -]?key|\bherstelsleutel|\bWiederherstellungsschlüssel|\bcl[ée] de (?:secours|récupération)|\bclave de recuperación|\bchiave di (?:recupero|ripristino)|\bklucz odzyskiwania|\bcheie de recuperare)\W{0,3}[A-Z0-9]{4}(?:-[A-Z0-9]{4}){5}(?![\w-])

jwt

JSON Web Token (JWT): a base64url header and payload, both starting with eyJ, and a signature, separated by dots; the signature may be empty, as in an unsecured token.

rre.jwt(text)

\beyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*

Matches are checked with jwt; one that fails it is dropped.

md5

MD5 hash: exactly 32 hexadecimal characters as a separate word, with a digit and a letter among them, like d41d8cd98f00b204e9800998ecf8427e; longer hex strings such as SHA-256, and digits only (a 32-digit eSIM EID), do not match.

rre.md5(text)

\b(?=[a-fA-F]{0,31}\d)(?=\d{0,31}[a-fA-F])[a-fA-F0-9]{32}\b

otpauth_uri

Two-factor authentication secret (2FA, TOTP or HOTP) as an authenticator app's QR code holds it, otpauth://totp/...?secret=..., or Google Authenticator's export otpauth-migration://offline?data=....

rre.otpauth_uri(text)

(?i)\botpauth://[th]otp/(?P<label>[^\s?#<>\"']{0,256})\?(?:[^\s&#?<>\"']{0,500}&){0,20}?secret=(?P<secret>[^\s&#<>\"']+)[^\s#<>\"']*(?<![.,;:!?)\]])|\botpauth-migration://offline\?data=[\w%+/=-]+

password

Text that could be a strong password: the whole input, on one line, of at least 8 characters with a digit, a lowercase and an uppercase letter; it checks one value, it does not search text.

rre.password(text)

^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$

password_hash

Password hash in crypt format, as in /etc/shadow or a database dump: bcrypt $2a$, md5-crypt $1$, sha256/512-crypt $5$/$6$, yescrypt, scrypt, Argon2, phpass and Django PBKDF2.

rre.password_hash(text)

(?:\$2[abxy]\$\d\d\$[./\w]{53}|\$(?:1|apr1)\$[./\w]{1,8}\$[./\w]{22}|\$[56]\$(?:rounds=\d+\$)?[./\w]{1,16}\$(?:[./\w]{86}|[./\w]{43})|\$y\$[./\w]+\$[./\w]{0,86}\$[./\w]{43}|\$7\$[./\w]{11,97}\$[./\w]{43}|\$argon2(?:id|i|d)\$(?:v=\d+\$)?m=\d+,t=\d+,p=\d+\$[\w+/]+\$[\w+/]+|\$[HP]\$[./\w]{31}|\bpbkdf2_sha(?:1|256)\$\d+\$\w+\$[\w+/]+={0,2})(?![\w/+$])

pgp_block

PGP armored block from its -----BEGIN PGP ...----- line to the END line of the same type: a public or private key block, an encrypted message, a signature, or a clear-signed message with its signature.

rre.pgp_block(text)

-----BEGIN PGP (?:SIGNED MESSAGE-----(?:(?!-----BEGIN )[\s\S])+-----BEGIN PGP (?=SIGNATURE))?(?P<type>PUBLIC KEY BLOCK|PRIVATE KEY BLOCK|MESSAGE|SIGNATURE)-----[^-]+(?:-[^-]+)*-----END PGP (?P=type)-----

pgp_fingerprint

OpenPGP key fingerprint, 40 hexadecimal digits, together or in groups of four, after PGP, GPG, OpenPGP, Key fingerprint = or openpgp4fpr:, keyword included, like PGP fingerprint: 65A1 86BA D7DB ....

rre.pgp_fingerprint(text)

(?i:\bopenpgp4fpr:|\b(?:(?:open)?pgp|gpg|gnupg)(?:[ -]?(?:public[ -]?)?key)?(?:[ -]?fingerprint)?\s?[:=]?\s?|\bkey fingerprint\s?=\s?|\b(?:primary key|subkey) fingerprint:\s?)(?:0x)?(?:[0-9A-Fa-f]{40}|[0-9A-Fa-f]{4}(?: {1,2}[0-9A-Fa-f]{4}){9})(?!\w)

private_key_block

PEM private key from its -----BEGIN ... PRIVATE KEY----- line to its END line: RSA, EC, DSA, OpenSSH, PKCS#8 and encrypted keys, with base64 in it (a ... placeholder does not match); PGP keys are matched by pgp_block.

rre.private_key_block(text)

-----BEGIN (?:[A-Z]+ )?PRIVATE KEY-----(?=(?:[^-]|-(?!-))*?[A-Za-z0-9+/]{16})[^-]+(?:-[^-]+)*-----END (?:[A-Z]+ )?PRIVATE KEY-----

session_id

Session messenger account ID: 05 followed by 64 lowercase hexadecimal characters, 66 in all.

rre.session_id(text)

\b05[0-9a-f]{64}\b

sha1

SHA-1 hash: exactly 40 hexadecimal characters as a separate word, with a digit and a letter among them, like da39a3ee5e6b4b0d3255bfef95601890afd80709, which is also the form of a Git commit ID.

rre.sha1(text)

\b(?=[a-fA-F]{0,39}\d)(?=\d{0,39}[a-fA-F])[a-fA-F0-9]{40}\b

sha256

SHA-256 hash: exactly 64 hexadecimal characters as a separate word, with a digit and a letter among them, like the hash of a file or a Bitcoin transaction ID.

rre.sha256(text)

\b(?=[a-fA-F]{0,63}\d)(?=\d{0,63}[a-fA-F])[a-fA-F0-9]{64}\b

sha512

SHA-512 hash: exactly 128 hexadecimal characters as a separate word, upper or lower case, with a digit and a letter among them.

rre.sha512(text)

\b(?=[a-fA-F]{0,127}\d)(?=\d{0,127}[a-fA-F])[a-fA-F0-9]{128}\b

slack_webhook_url

Slack incoming webhook URL, which lets anyone holding it post to a channel, like https://hooks.slack.com/services/T.../B.../...; also workflow and trigger webhooks, and hooks.slack-gov.com.

rre.slack_webhook_url(text)

(?<![\w.-])(?:https?://)?hooks\.slack(?:-gov)?\.com/(?:services|workflows|triggers)/T[A-Z0-9]{6,12}(?:/[A-Za-z0-9]{6,40}){2,3}(?![\w-])

ssh_fingerprint

SSH key fingerprint as ssh-keygen and ssh print it: SHA256: and 43 base64 characters, or the older MD5 form, 16 colon-separated hexadecimal pairs, with or without MD5:.

rre.ssh_fingerprint(text)

\bSHA256:[A-Za-z0-9+/]{42}[AEIMQUYcgkosw048](?![\w+/=])|(?<![\w:])(?:MD5:)?(?=[0-9a-f:]{0,46}[a-f])[0-9a-f]{2}(?::[0-9a-f]{2}){15}(?![\w:])

ssh_public_key

OpenSSH public key: key type (ssh-ed25519, ssh-rsa, ecdsa-sha2-nistp256, ...) and base64 key starting with AAAA, with its user@host comment, as in authorized_keys.

rre.ssh_public_key(text)

\b(?:ssh-(?:ed25519|rsa|dss)|ecdsa-sha2-nistp(?:256|384|521)|sk-(?:ssh-ed25519|ecdsa-sha2-nistp256)@openssh\.com) AAAA[0-9A-Za-z+/]{60,}={0,3}(?: [\w.-]+@[\w-]+(?:\.[\w-]+)*)?

wifi_qr_string

Wi-Fi QR code text with a network's name and password: WIFI: and fields such as T (security), S (SSID), P (password) and H (hidden) in any order, like WIFI:T:WPA;S:TestNet;P:test-pass;;.

rre.wifi_qr_string(text)

\bWIFI:(?=(?:[A-Z][A-Z\d]{0,2}:(?:[^;\\\r\n]|\\.){0,128};){0,12}?S:(?P<ssid>(?:[^;\\\r\n]|\\.){1,128});)(?=(?:(?:[A-Z][A-Z\d]{0,2}:(?:[^;\\\r\n]|\\.){0,128};){0,12}?P:(?P<password>(?:[^;\\\r\n]|\\.){0,128});)?)(?:[A-Z][A-Z\d]{0,2}:(?:[^;\\\r\n]|\\.){0,128};){1,12};?

windows_product_key

Windows or Office product key: five groups of five from the product key alphabet (no vowels, 0, 1 or 5; one N since Windows 8), like W269N-WFGWX-YVC9B-4J6C9-T83GX.

rre.windows_product_key(text)

(?<![\w-])(?=[\w-]{0,28}[A-Z])(?=[\w-]{0,28}\d)(?![\w-]{0,27}N[\w-]{0,27}N)[B-DF-HJKMNP-RTV-Y2-46-9]{5}(?:-[B-DF-HJKMNP-RTV-Y2-46-9]{5}){4}(?![\w-])

Devices, apps and paths

function checksum validator
rre.android_app_data_path
rre.android_id
rre.android_system_path
rre.app_cache_path
rre.app_package_name app_package_name
rre.app_sound_path
rre.apple_ecid
rre.apple_serial_number
rre.cocos_asset_path
rre.effect_package_path
rre.embedded_piece_path
rre.gurd_cache_path
rre.ios_app_bundle_path
rre.ios_app_container_path
rre.ios_system_path
rre.ios_udid
rre.ios_voice_trigger_path
rre.scaled_asset_path
rre.script_bundle_path
rre.speech_synthesis_path
rre.usb_vid_pid
rre.uuid
rre.valdi_resource_path
rre.windows_path
rre.windows_app_cache_path
rre.windows_program_data_path
rre.windows_program_path
rre.windows_sid
rre.windows_system_path

android_app_data_path

Android app's own storage: a path on the device in /data/data/, /data/user/0/, /data/user_de/0/ or /storage/emulated/0/Android/data/ (or media, obb); the package name is a named group.

rre.android_app_data_path(text)

^(?:/data/(?:data|user(?:_de)?/\d{1,3})|(?:/storage/(?:emulated/\d{1,3}|self/primary|[0-9A-F]{4}-[0-9A-F]{4})|/(?:mnt/)?sdcard|/data/media/\d{1,3})/Android/(?:data|media|obb))/(?P<package>[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)+)(?:/.*|$)

android_id

Android ID (ANDROID_ID, SSAID) after Android ID, android_id or SSAID, also in settings XML, keyword included in the match: 16 hexadecimal characters, like Android ID: 3f2b9c71d04e8a65.

rre.android_id(text)

\b(?i:android[ _-]?id|ssaid)(?:\W{1,4}|"\s{1,3}value=")(?P<android_id>[0-9a-fA-F]{13,16})\b

android_system_path

Android system file: a path on the device that starts in a folder Android keeps for itself (/system/, /system_ext/, /product/, /vendor/, /apex/, ...); /data/ paths do not match.

rre.android_system_path(text)

^/(?:system|system_ext|system_root|product|vendor|odm|oem|apex|bin|sbin)/.*

app_cache_path

App clutter path: a file under a folder named cache, Caches, thumbnails or .thumbnails, or under a folder or file whose name starts with emoji, sticker or drawable (any case), like /data/data/com.example/cache/1.jpg.

rre.app_cache_path(text)

^/(?:[^/\n]+/)*?(?:(?i:\.?(?:caches?|thumbnails))/|(?i:emoji|sticker|drawable))[^\n]*

app_package_name

Android package name or iOS bundle ID (reverse-DNS app ID) like com.whatsapp, org.telegram.messenger or net.whatsapp.WhatsApp, also in paths, store links and .plist names; web domains do not match.

rre.app_package_name(text)

(?<![\w.@-])(?:com|org|net|app|dev|group|network|[a-z]{2})(?:\.[A-Za-z](?:[A-Za-z0-9_-]{0,61}[A-Za-z0-9_])?){1,12}(?![\w@-]|\.[A-Za-z])

Matches are checked with app_package_name; one that fails it is dropped.

app_sound_path

App sounds: a path on the device in a folder where an app keeps its own notification and effect sounds, Library/Sounds/ or Library/Caches/Sounds/ in an iOS app's data container, or a navigation app's sound/ folder on Android; the app's other data does not match.

rre.app_sound_path(text)

^(?:(?:/private)?/var/mobile/Containers/Data/Application/[^/\n]+/Library/(?:Caches/)?Sounds|/data/(?:data|user(?:_de)?/\d{1,3})/com\.waze/[^/\n]+/sound)/[^\n]*

apple_ecid

Apple ECID (Exclusive Chip ID, UniqueChipID) after ECID or Unique Chip ID, also in a plist, keyword included in the match: hexadecimal with or without 0x, or decimal, like ECID: 0x1A2B3C4D5E6F7.

rre.apple_ecid(text)

\b(?i:ecid|unique ?chip ?id)(?:\W{1,4}|</key>\s{0,9}<integer>)(?P<ecid>0[xX][0-9A-Fa-f]{6,16}|[0-9A-Fa-f]{10,16}|\d{17,20})\b

apple_serial_number

Apple serial number after Serial Number, S/N, serienummer, numéro de série, ..., keyword included in the match: 12 characters (2010-2021), 11 (older) or 10 random ones, like Serial Number: C02XL0GHJGH5.

rre.apple_serial_number(text)

\b(?i:serial(?:[ _-]?(?:number|no|nr))?|s/?n|serien?nummer|n[uú]m[eé]ro d[ei] s[eé]rie|n° de s[eé]rie|numer seryjny|num[aă]r(?:ul)? de serie)(?:\W{1,4}|</key>\s{0,9}<string>)(?P<serial>[A-Z0-9]{3}[CDFGHJ-NP-TV-Z][1-9CDFGHJ-NP-RTV-Y][A-Z0-9]{7}|(?=\d{0,10}[A-Z])[A-Z0-9]{2}\d(?:0[1-9]|[1-4]\d|5[0-3])[A-Z0-9]{6}|(?=[A-Z]{0,9}\d)(?=\d{0,9}[A-Z])[A-Z0-9]{10})\b

cocos_asset_path

Game engine assets: a path on the device to a file a game built with the Cocos engine keeps for itself, by the engine's own layout assets/<bundle>/native/<two hex digits>/<uuid>.<extension>: the game's artwork, sounds and fonts, downloaded with the game or after it, never the player's own files.

rre.cocos_asset_path(text)

^/[^\n]*/assets/[^/\n]+/native/[0-9a-f]{2}/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}(?:\.[0-9a-f]{5})?\.[A-Za-z0-9]{1,8}$

effect_package_path

Effect packages: a path on the device under Documents/com.bytedance.artist-effects/ in an iOS app's data container, where apps from one large publisher keep the camera effects they download from their maker: images, textures and settings, the same on every phone.

rre.effect_package_path(text)

^(?:/private)?/var/mobile/Containers/Data/Application/[^/\n]+/Documents/com\.bytedance\.artist-effects/[^\n]*

embedded_piece_path

Embedded piece: a path on the device to a file cut out of another file and named after it, <name>/<name>_embedded_<number>.<extension>, as device reports list the images found inside a cache entry, a document or an app's content file; _partial before the extension marks a piece of which only part was recovered.

rre.embedded_piece_path(text)

^[^\n]*/([^/\n]+)/\1_embedded_\d+(?:_partial)?\.[^/.\n]+$

gurd_cache_path

App resource packages: a path on the device under Library/Application Support/gurd_cache/ in an iOS app's data container, where apps from one large publisher keep the packages they download from their maker: animation frames, effects and stickers, the same on every phone.

rre.gurd_cache_path(text)

^(?:/private)?/var/mobile/Containers/Data/Application/[^/\n]+/Library/Application Support/gurd_cache/[^\n]*

ios_app_bundle_path

iOS app bundle: a path on the device in the folder where iOS installs apps, /private/var/containers/Bundle/ (the read-only, signed app with its own images, sounds and videos, and its install metadata); an app's data container does not match.

rre.ios_app_bundle_path(text)

^(?:/private)?/var/containers/Bundle/.*

ios_app_container_path

iOS app container: a path on the device in an app's data, app group, extension or bundle folder, like /private/var/mobile/Containers/Data/Application/<GUID>/...; the GUID is a named group.

rre.ios_app_container_path(text)

^(?:/private)?/var/(?:mobile/Containers/(?:Data/(?:Application|PluginKitPlugin)|Shared/AppGroup)|containers/Bundle/Application)/(?P<guid>[0-9A-Fa-f]{8}-(?:[0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12})(?:/.*|$)

ios_system_path

iOS system file: a path on the device that starts in a folder iOS keeps for itself (/System/, /Library/, /Applications/, /usr/, /private/preboot/Cryptexes/, ...), or in /private/var/MobileAsset/, where iOS keeps the voices, fonts and models it downloads; user data does not match.

rre.ios_system_path(text)

^(?:/private/preboot/Cryptexes|(?:/private)?/var/MobileAsset|/(?:System|Library|Applications|Developer|usr|bin|sbin))/.*

ios_udid

iPhone or iPad UDID: the newer form of chip ID and ECID, like 00008030-001A2B3C4D5E802E, or 40 hexadecimal characters after UDID, UniqueDeviceID or Unique Identifier, keyword included in the match.

rre.ios_udid(text)

\b(?:(?i:udid|unique ?device ?id(?:entifier)?|(?:unique|target) ?identifier)(?:\W{1,4}|</key>\s{0,9}<string>)(?P<udid>[0-9a-fA-F]{40})|(?P<chip_id>0000[0-9A-Fa-f]{4})-(?P<ecid>[0-9A-Fa-f]{16}))\b

ios_voice_trigger_path

iOS voice trigger samples: a path on the device under /private/var/mobile/Library/VoiceTrigger/, where iOS keeps the short recordings of the owner saying the assistant's wake phrase.

rre.ios_voice_trigger_path(text)

^(?:/private)?/var/mobile/Library/VoiceTrigger/[^\n]*

scaled_asset_path

Scaled interface image: a path on the device to an image whose name ends in @2x or @3x before the extension (icon@2x.png, logo@3x~ipad.png), the way iOS apps name the versions of an interface graphic made for sharper screens: an app's own artwork, not a photo.

rre.scaled_asset_path(text)

^/[^\n]*/[^/\n]+@[23]x(?:~(?:iphone|ipad))?\.(?:[Pp][Nn][Gg]|[Jj][Pp][Ee]?[Gg]|[Gg][Ii][Ff]|[Ww][Ee][Bb][Pp])$

script_bundle_path

Script bundles: a path on the device under Documents/RNbundles/ in an iOS app's data container, where an app keeps the script bundles of its screens together with the pictures those screens use.

rre.script_bundle_path(text)

^(?:/private)?/var/mobile/Containers/Data/Application/[^/\n]+/Documents/RNbundles/[^\n]*

speech_synthesis_path

Synthetic speech: a path on the device in a folder where an app or the OS keeps text-to-speech audio and voices, Library/Caches/tts/ in an iOS app's data container, Android's com.google.android.tts, or a navigation app's tts/, voice/ or voicehttp/ folder; spoken by a machine, though the words can name streets of a route.

rre.speech_synthesis_path(text)

^(?:(?:/private)?/var/mobile/Containers/Data/Application/[^/\n]+/Library/Caches/tts|/data/(?:data|user(?:_de)?/\d{1,3})/(?:com\.google\.android\.tts|com\.waze/[^/\n]+/tts)|(?:/storage/(?:emulated/\d{1,3}|self/primary)|/(?:mnt/)?sdcard|/data/media/\d{1,3})/Android/data/com\.google\.android\.apps\.maps/[^/\n]+/voice(?:http)?)/[^\n]*

usb_vid_pid

USB vendor and product ID: Windows' VID_1234&PID_ABCD, Linux's idVendor=1234, idProduct=abcd, lsusb's ID 1234:abcd after Device 003:, or after USB ID or VID:PID, keyword included: USB ID 1234:abcd.

rre.usb_vid_pid(text)

(?i:\bVID_[0-9a-f]{4}&PID_[0-9a-f]{4}|\bidVendor=[0-9a-f]{4}, idProduct=[0-9a-f]{4}|(?:\busb[ _-]?id|\bvid[:/]pid)[ :=]{1,2}[0-9a-f]{4}:[0-9a-f]{4})(?![0-9A-Fa-f])|(?<=Device \d{3}: )ID [0-9a-f]{4}:[0-9a-f]{4}(?![0-9A-Fa-f])

uuid

UUID (GUID): 32 hexadecimal characters in groups of 8-4-4-4-12 separated by hyphens, like 550e8400-e29b-41d4-a716-446655440000.

rre.uuid(text)

\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b

valdi_resource_path

Interface resources: a path on the device under Documents/Valdi/resources-<name>.dir/ in an iOS app's data container, where an app built with the Valdi interface framework keeps the pictures of its own screens.

rre.valdi_resource_path(text)

^(?:/private)?/var/mobile/Containers/Data/Application/[^/\n]+/Documents/Valdi/resources-[^/\n]+\.dir/[^\n]*

windows_path

Windows file path: a drive path like C:\Users\Jane\report.docx (also after \\?\) or a network path like \\server\share\a.txt; spaces are allowed in folder names, not in the file name, and the backslashes may be doubled, as in JSON.

rre.windows_path(text)

(?:(?<!\w)[A-Za-z]:|(?<![\w\\])\\\\(?:\\\\)?[\w.-]+)(?:\\\\?[^\s\\/:*?"<>|]+(?: [^\s\\/:*?"<>|]+)*(?=\\))*\\\\?[^\s\\/:*?"<>|]+(?<![.,;!?)'])

windows_app_cache_path

Windows per-user program material: a path under a user's AppData\Local\ in a folder that holds what programs install, download or generate for themselves, not what the user made: per-user programs and updaters (Programs\, Microsoft\WindowsApps\, Package Cache\), theme packs (Microsoft\Windows\Themes\), lock-screen, widget, weather and news pictures (Packages\Microsoft.Windows.ContentDeliveryManager_...\), crash reports, package-manager caches, a browser's extensions and compiled-code and graphics caches, and the web cache of a program's built-in browser (EBWebView\<profile>\Cache\); with or without a drive letter, either slash, any case. A browser's own web cache, Temp\, the thumbnail cache and other Packages\ folders do not match.

rre.windows_app_cache_path(text)

(?i)^(?:[a-z]:)?[\\/]?Users[\\/][^\\/]+[\\/]AppData[\\/]Local[\\/](?:Microsoft[\\/]Windows[\\/](?:Themes|WER|Caches)|Microsoft[\\/](?:WindowsApps|EdgeUpdate|OneDrive[\\/]\d[^\\/]*|Teams[\\/]current)|Packages[\\/](?:Microsoft\.Windows\.ContentDeliveryManager|MicrosoftWindows\.Client\.WebExperience|Microsoft\.Bing(?:Weather|News))_[^\\/]*|(?:Programs|Package Cache|SquirrelTemp|CrashDumps|D3DSCache|npm-cache|NuGet)|(?:Google[\\/]Update|pip[\\/]cache|Yarn[\\/]Cache|Spotify[\\/](?:Data|Storage))|(?:[^\\/]+[\\/])+(?:Code Cache|GPUCache|ShaderCache|GrShaderCache|DawnCache|DawnGraphiteCache|DawnWebGPUCache|Extensions)|(?:[^\\/]+[\\/])+EBWebView[\\/][^\\/]+[\\/]Cache)[\\/].*

windows_program_data_path

Windows shared program data: a path that starts in ProgramData\, where programs keep data for all users of the computer, with or without a drive letter, either slash, any case; a ProgramData folder further down does not match.

rre.windows_program_data_path(text)

(?i)^(?:[a-z]:)?[\\/]?ProgramData[\\/].*

windows_program_path

Windows program file: a path that starts in a folder where Windows installs programs, Program Files\ or Program Files (x86)\ (what a program ships: its own images, sounds and libraries), with or without a drive letter, either slash, any case; ProgramData\ and a user's AppData\ do not match.

rre.windows_program_path(text)

(?i)^(?:[a-z]:)?[\\/]?Program Files(?: \(x86\))?[\\/].*

windows_sid

Windows security identifier (SID): S-1-, an authority and two or more subauthorities, like S-1-5-32-544 or S-1-5-21-...-512; short well-known SIDs like S-1-5-18 do not match.

rre.windows_sid(text)

\bS-1-\d{1,2}(?:-\d{1,10}){2,14}(?!-?\d)

windows_system_path

Windows system file: a path that starts in a folder Windows keeps for itself, Windows\ or a setup folder beside it ($WinREAgent\, $Windows.~BT\, $Windows.~WS\), with or without a drive letter, either slash, any case; Users\, ProgramData\ and Windows.old\ (which holds the previous installation's user folders) do not match.

rre.windows_system_path(text)

(?i)^(?:[a-z]:)?[\\/]?(?:Windows|\$WinREAgent|\$Windows\.~(?:BT|WS))[\\/].*

Files and media

function checksum validator
rre.camera_filename
rre.messenger_media_filename
rre.screenshot_filename
rre.whatsapp_media_filename

camera_filename

Camera photo or video file name: IMG_20260302_081512.jpg, Pixel's PXL_..., Samsung's 20260302_081512.jpg, IMG_0001.HEIC, DSC01234.JPG, GoPro, DJI, ...; the date and time are named groups.

rre.camera_filename(text)

\b(?:(?:(?:IMG|VID|PXL|MVIMG|PANO|DJI)_?|(?=\d{8}_))(?P<date>(?:19|20)\d\d(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01]))_?(?P<time>(?:[01]\d|2[0-3])[0-5]\d[0-5]\d)(?:\d{3})?|(?:IMG_E?|DSC[_FN]?|_DSC|MVI_|MOV_|GOPR|G[HX]\d\d|DJI_)\d{4,5})(?:[_~ -]\w{1,20}|\(\d{1,3}\))?(?:\.[A-Z]{2,9}){0,2}\.(?i:jpe?g|hei[cf]|png|dng|gif|webp|mp4|mov|3gp|m4v|avi|cr[23]|nef|arw|raf|orf|rw2|lrv)(?![A-Za-z0-9])

messenger_media_filename

Media file name from Signal or Telegram: Signal's saved signal-2026-03-03-091244.jpg, Telegram Desktop's photo_2026-03-03_09-12-44.jpg and its chat export's photo_1@03-03-2026_09-12-44.jpg.

rre.messenger_media_filename(text)

\b(?:signal(?:-attachment)?-|(?:photo|video|audio|doc)_|(?:photo|video|file|audio|story)_\d{1,6}@)(?P<date>(?:19|20)\d\d-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])|(?:0[1-9]|[12]\d|3[01])-(?:0[1-9]|1[0-2])-(?:19|20)\d\d)[-_](?P<time>(?:[01]\d|2[0-3])-?[0-5]\d-?[0-5]\d)(?:-\d{3})?(?:_\d{3}|-\d{1,4}| \(\d{1,4}\))?\.[A-Za-z0-9]{2,5}(?![A-Za-z0-9])

screenshot_filename

Screenshot file name of Android, macOS (also in Dutch, French, German, Spanish, Italian, Polish), Windows and Linux, like Screenshot_20260302-081512.png or Screenshot 2026-03-02 at 08.15.12.png; an impossible date or time does not match.

rre.screenshot_filename(text)

\b(?:Screenshot(?: from)?|Screen Shot|Schermafbeelding|Bildschirmfoto|Capture d[’']écran|Captura de pantalla|Schermata|Zrzut ekranu)[_ ](?P<date>(?:19|20)\d\d-?(?:0[1-9]|1[0-2])-?(?:0[1-9]|[12]\d|3[01]))(?:[-_ ]| (?:at|om|um|à|a las|alle|o) )(?P<time>(?:[01]?\d|2[0-3])[.-]?[0-5]\d[.-]?[0-5]\d)(?:\s?[AP]M)?(?:-\d{1,3})?(?:_[\w .-]{1,60}?)?(?: ?\(\d{1,3}\))?\.(?i:png|jpe?g|webp|heic)(?![A-Za-z0-9])

whatsapp_media_filename

WhatsApp media file name: IMG-20260303-WA0007.jpg, VID-, AUD-, PTT- (voice note), STK- (sticker), DOC-, and WhatsApp Web's WhatsApp Image 2026-03-03 at 09.12.44.jpeg; date and time are named groups.

rre.whatsapp_media_filename(text)

\b(?:(?:IMG|VID|AUD|PTT|STK|DOC)-|WhatsApp[ _-](?:Image|Video|Audio|Ptt)[ _-])(?P<date>(?:19|20)\d\d-?(?:0[1-9]|1[0-2])-?(?:0[1-9]|[12]\d|3[01]))(?:-WA\d{4,5}|[ _-]at[ _-](?P<time>(?:[01]?\d|2[0-3])\.[0-5]\d\.[0-5]\d)(?:\s?[AP]M)?)(?:[_~ -]\w{1,20}| ?\(\d{1,3}\))?\.[A-Za-z0-9]{2,5}(?![A-Za-z0-9])

Dates and times

function checksum validator
rre.cellebrite_datetime
rre.exif_datetime
rre.iso_datetime
rre.mac_absolute_time mac_absolute_time
rre.rfc2822_datetime
rre.unix_timestamp unix_timestamp
rre.webkit_timestamp webkit_timestamp
rre.windows_filetime windows_filetime
rre.windows_timezone_name

cellebrite_datetime

Date and time as Cellebrite shows them, with the UTC offset in brackets: day and month in either order, like 2/3/2026 8:15:12(UTC+1), 14/09/2026 09:15:00(UTC+05:30) or 3/2/2026 8:15:12 AM(UTC+0); 13/13/2026 or hour 24 do not match.

rre.cellebrite_datetime(text)

(?<![\w/.-])(?=(?:0?[1-9]|1[0-2])\D|\d\d?\D(?:0?[1-9]|1[0-2])\D)(?:0?[1-9]|[12]\d|3[01])([/.-])(?:0?[1-9]|[12]\d|3[01])\1(?:\d\d)?\d\d (?:[01]?\d|2[0-3]):[0-5]\d:[0-5]\d(?: ?[AP]M)? ?\(UTC ?(?:[+-](?:0?\d|1[0-4])(?::?[0-5]\d)?)?\)

exif_datetime

EXIF date and time (DateTimeOriginal, DateTimeDigitized) with colons in the date, like 2026:03:02 08:15:12, also with fractions of a second and a UTC offset as ExifTool writes them: 2026:03:02 08:15:12+01:00.

rre.exif_datetime(text)

(?<![\d:])(?:19|20)\d\d:(?:0[1-9]|1[0-2]):(?:0[1-9]|[12]\d|3[01]) (?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d{1,6})?(?:Z|[+-](?:0\d|1[0-4]):[0-5]\d)?(?![\d:])

iso_datetime

ISO 8601 date YYYY-MM-DD, with an optional time after T or a space (seconds, fractions, Z or a UTC offset), like 2024-03-02 or 2024-03-01T14:30:05Z.

rre.iso_datetime(text)

\b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])(?:[T ](?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?)?\b

mac_absolute_time

Mac absolute time (Cocoa, CFAbsoluteTime) in iOS and macOS databases: seconds since 2001, often with a fraction, or nanoseconds, after its name or a Core Data column like ZDATE, keyword included: ZDATE: 794221964.5.

rre.mac_absolute_time(text)

(?:\b(?i:(?:mac(?:os)?|apple|cf)[ _-]?absolute[ _-]?time|(?:apple[ _-]?)?(?:cocoa|core[ _-]?data)(?:[ _-]?core[ _-]?data)?[ _-]?(?:time(?:stamp)?|date))["']?\s?[:=]?|["']?\bZ[A-Z]{0,30}(?:DATE|TIME|STAMP)[A-Z0-9]{0,12}["']?\s?[:=])\s?["']?(?P<timestamp>\d{18,19}|\d{9,10}(?:\.\d{1,9})?)(?!\d|\.\d)["']?

Matches are checked with mac_absolute_time; one that fails it is dropped.

rfc2822_datetime

Email date and time (RFC 2822/5322) as in Date and Received headers: an optional weekday, day, English month, year, time and zone, like Tue, 3 Mar 2026 09:12:44 +0100 or 3 Mar 2026 08:12 GMT.

rre.rfc2822_datetime(text)

\b(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), {1,2})?(?:0?[1-9]|[12]\d|3[01]) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?:19|20)\d\d (?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)? (?:[+-](?:0\d|1[0-4])[0-5]\d|UT|GMT|[ECMP][SD]T)\b

unix_timestamp

Unix time (2000 to 2040) in seconds or milliseconds after a label: unix time, epoch, timestamp or a key like date, created_at or ts (JSON, URL, log; not an _id key), keyword included in the match: "timestamp": 1772409600.

rre.unix_timestamp(text)

(?i:["']?\b(?:(?:unix|epoch|posix)(?:[ _-]?(?:time(?:stamp)?|epoch|tijd|zeit))?|\w{0,30}?(?:time[ _-]?stamp|stempel|horodatage)\w{0,10})["']?\s?[:=]?|["']?\b(?:\w{0,30}?(?:time|date|created|modified|updated|expir)\w{0,20}(?<!_id)|ts|iat|exp|nbf)["']?\s?[:=]|usagestats/(?:\d{1,3}/)?(?:daily|weekly|monthly|yearly)/)\s?["']?(?P<timestamp>\d{9,13})(?!\d)["']?

Matches are checked with unix_timestamp; one that fails it is dropped.

webkit_timestamp

WebKit or Chrome time (2000 to 2040): 17 digits, microseconds since 1601, after WebKit or Chrome time or a key like last_visit_time or expires_utc, keyword included in the match: "last_visit_time": 13417002764123456.

rre.webkit_timestamp(text)

(?:\b(?i:(?:webkit|chrom(?:e|ium))[ _-]?(?:time(?:stamp)?|epoch))["']?\s?[:=]?|["']?\b(?i:\w{0,30}?(?:time|date|utc|created|modified|added|used|expir)\w{0,20})["']?\s?[:=])\s?["']?(?P<timestamp>\d{17})(?!\d)["']?

Matches are checked with webkit_timestamp; one that fails it is dropped.

windows_filetime

Windows FILETIME, also LDAP/Active Directory time (2000 to 2040): 18 digits or 0x and 16 hex, 100 ns since 1601, after FILETIME, pwdLastSet, lastLogon or a time key, keyword included: FILETIME: 0x01DCAAEDE4FC8E00.

rre.windows_filetime(text)

(?:\b(?i:(?:(?:windows|win32|ntfs?)[ _-]?)?file[ _-]?time|(?:ldap|ntfs?|win32)[ _-]?time(?:stamp)?|pwd[ _-]?last[ _-]?set)["']?\s?[:=]?|["']?\b(?i:\w{0,30}?(?:time|date|created|modified|written|accessed|changed|expir|logon|logoff)\w{0,20})["']?\s?[:=])\s?["']?(?P<timestamp>\d{18}(?!\d)|0x[0-9A-Fa-f]{16}(?![0-9A-Fa-f]))["']?

Matches are checked with windows_filetime; one that fails it is dropped.

windows_timezone_name

Windows time zone name, as Cellebrite records the extraction's zone: (UTC±hh:mm) and its place names, also translated, like (UTC+01:00) Brussels, Copenhagen, Madrid, Paris or (UTC) Coordinated Universal Time.

rre.windows_timezone_name(text)

(?<![\d:])(?<!\d )\((?:(?:UTC|GMT)[+-](?:0\d|1[0-4]):[0-5]\d|UTC(?=\) Coordinated Universal Time))\) (?:[A-Z][a-z]?\.|[A-ZÀ-Þ(][\w'’()&+-]*)(?:,? (?:(?:of|and|en|et|und|y|e|i|de|del|di|du|la|le) )?(?:[A-Z][a-z]?\.|[A-ZÀ-Þ(&-][\w'’()&+-]*)){0,15}

Places and addresses

function checksum validator
rre.exif_gps_rational exif_gps_rational
rre.gps_coordinates
rre.gps_dms
rre.maps_link
rre.plus_code
rre.port_code
rre.what3words

exif_gps_rational

Raw EXIF GPS latitude or longitude: degrees, minutes and seconds as three fractions with denominators 1, 10, 100, ..., at least one of them 1, like 51/1, 15/1, 4536/100; minutes and seconds above 59 and dates like 1/10, 2/10, 3/10 do not match.

rre.exif_gps_rational(text)

(?<![\w/.])\d{1,10}/10{0,9}(?:,\s?|\s)\d{1,10}/10{0,9}(?:,\s?|\s)\d{1,10}/10{0,9}(?![\d/])

Matches are checked with exif_gps_rational; one that fails it is dropped.

gps_coordinates

GPS coordinates in decimal degrees: latitude and longitude with at least four decimals, separated by a comma, like 51.0543, 3.7174 or -33.8688,151.2093; out-of-range values like 91.0000 do not match.

rre.gps_coordinates(text)

(?<!\d)(?<!\d\.)[-+]?(?:[1-8]?\d\.\d{4,}|90\.0{4,})\s*,\s*[-+]?(?:(?:1[0-7]\d|[1-9]?\d)\.\d{4,}|180\.0{4,})(?!\.?\d)

gps_dms

GPS coordinate in degrees (at most 180), minutes and seconds (below 60) with its direction letter (N, S, E, W or O), like 51°03'15.5"N or, as ExifTool and Cellebrite write it, 51 deg 15' 45.36" N; latitude and longitude are separate matches.

rre.gps_dms(text)

(?<![\d.])(?:1[0-7]\d|180|0?\d?\d)(?:°|\s?deg)\s?[0-5]?\d['′]\s?[0-5]?\d(?:\.\d+)?[\"″]\s?[NSEWO]

Map link: Google Maps (google.com/maps, maps.google, maps.app.goo.gl, goo.gl/maps), Apple Maps (maps.apple.com) or Waze, with its full path and coordinates.

rre.maps_link(text)

(?i)(?<![\w.-])(?:https?://)?(?:www\.)?(?:google\.(?:com?\.)?[a-z]{2,3}/maps|maps\.google\.(?:com?\.)?[a-z]{2,3}|maps\.app\.goo\.gl|goo\.gl/maps|maps\.apple(?:\.com)?|(?:ul\.)?waze\.com)[/?][^\s<>"']+(?<![.,;:!?)\]])

plus_code

Google Plus Code (Open Location Code): full like 8FVC9G8F+6X or short like 9G8F+6X, with at least one letter, so sums like 2345+6789 do not match.

rre.plus_code(text)

(?<![\w+])(?=[2-9+]*[CFGHJMPQRVWX])(?:[2-9C][2-9CFGHJMPQRV][2-9CFGHJMPQRVWX]{2})?[2-9CFGHJMPQRVWX]{4}\+[2-9CFGHJMPQRVWX]{2,7}(?![\w+])

port_code

Port code (UN/LOCODE): a country code and three letters or digits after UN/LOCODE, port of loading or discharge, POL, POD, laadhaven, Löschhafen, ..., keyword included in the match, like POL: ECGYE or Port of discharge: BE ANR.

rre.port_code(text)

\b(?:(?i:un/?locode|locode|port of (?:loading|discharge|destination|entry|call)|place of (?:receipt|delivery)|(?:laad|los|bestemmings)haven|port de (?:chargement|d[ée]chargement|destination)|(?:lade|lösch|ziel)hafen|puerto de (?:carga|descarga|destino)|porto di (?:carico|scarico|destinazione))|POL|POD)(?:\s?[:#]\s?|\s)[A-Z]{2} ?[A-Z2-9]{3}\b

what3words

what3words address: three words after ///, in any script, or in a w3w.co or what3words.com link, like ///filled.count.soap.

rre.what3words(text)

(?:(?<![:/])///|(?<![\w.-])(?:https?://)?(?:www\.)?(?:w3w\.co|what3words\.com)/)[^\W\d_]+\.[^\W\d_]+\.[^\W\d_]+(?!\.?\w)

Vehicles, ships and parcels

function checksum validator
rre.air_waybill air_waybill
rre.aircraft_icao_address
rre.airline_ticket_number
rre.bill_of_lading
rre.boarding_pass_barcode bcbp
rre.booking_reference
rre.container_number iso6346
rre.customs_mrn iso6346
rre.dhl_tracking_number dhl
rre.dpd_tracking_number dpd
rre.fedex_tracking_number fedex
rre.flight_number
rre.gls_tracking_number gls
rre.imo_number imo
rre.mmsi
rre.seal_number
rre.un_number
rre.ups_tracking_number ups_1z
rre.upu_tracking_number upu_s10
rre.usps_tracking_number usps
rre.vin

air_waybill

Air waybill number (AWB) after AWB, MAWB or air waybill, keyword included in the match: a 3-digit airline prefix and 8 digits, like AWB 020-12345675 or MAWB: 17681140743.

rre.air_waybill(text)

\b(?i:m?awb|air ?way ?bill)(?:\s?(?i:no|nr|number)\.?)?\W{0,4}\d{3}[- ]?\d{4} ?\d{4}\b

Matches are checked with air_waybill; one that fails it is dropped.

aircraft_icao_address

Aircraft ICAO 24-bit address (Mode S code, as in ADS-B data) after ICAO, ICAO 24-bit address, icao24 or Mode S (not the word modes), keyword included in the match: 6 hexadecimal digits, like Mode S hex 44A1B2.

rre.aircraft_icao_address(text)

\b(?:(?i:icao(?:[ _-]?24(?:[ -]?bit)?)?(?:[ -]?(?:hex|address|addr|code))?)|(?i:mode)(?:[ -][Ss]|S)(?i:[ -]?(?:hex|code|address))?)(?:\"?\s?[:=]\s?\"?|\s)[0-9A-Fa-f]{6}\b

airline_ticket_number

Airline ticket number (e-ticket, ETKT) after ticket, e-ticket, TKT, Ticketnummer, billet or billete, keyword included in the match: a 3-digit airline code and 10 digits, like ETKT 057-2123456789.

rre.airline_ticket_number(text)

\b(?i:e-?ticket|e?tkt|ticket|billete?|biglietto|biletu?)(?i:[ _-]?(?:number|nummer|nbr|no|nr|n°))?\.?(?:"?\s?[:=#]\s?"?|\s)\d{3}[- ]?\d{10}\b

bill_of_lading

Bill of lading (B/L) number after bill of lading, B/L, HBL, MBL, cognossement, connaissement, Konnossement, ..., keyword included in the match, like B/L No.: 123456789; or bare after a shipping line's prefix (Maersk, MSC, CMA CGM, Hapag-Lloyd, COSCO, ...), like MAEU240512345.

rre.bill_of_lading(text)

\b(?:(?i:bill of lading|[hm]?b/l|[hm]bl|cognossement|connaissement|konnossement|conocimiento de embarque|polizza di carico|konosament|conosament)|BOL|BL(?=[ .-]?(?i:no|nr|number|#)))(?:[ ._-]?(?i:no|nr|number|nummer|n°|num[eé]ro|#))?\.?(?:\s?[:#]\s?|\s)(?=[A-Z-]{0,19}\d)[A-Z0-9][A-Z0-9-]{4,18}[A-Z0-9]\b|\b(?:MAEU|SUDU|MEDU|CMDU|APLU|ANNU|HLCU|COSU|OOLU|EGLV|ONEY|YMLU|ZIMU|HDMU|PCIU|WHLC)(?=(?:[A-Z]*\d){5})[A-Z0-9]{8,12}\b

boarding_pass_barcode

Boarding pass barcode text (IATA BCBP), as a scanner reads it: M, the number of legs, the passenger's name and per leg the booking reference, airports, flight, date and seat, up to the barcode's end.

rre.boarding_pass_barcode(text)

(?<![A-Za-z0-9])M[1-4][A-Z][A-Z/ .'-]{19}[E ][A-Z0-9 ]{7}[A-Z]{6}[A-Z0-9 ]{3}[0-9 ]{4}[A-Z ]\d{3}[A-Z][A-Z0-9 ]{10}[0-9A-F]{2}[^\r\n]{0,1500}

Matches are checked with bcbp; one that fails it is dropped.

booking_reference

Booking reference (PNR, record locator) after booking reference, PNR, boekingscode, Buchungscode, localizador, ..., also with number or no. after it, keyword included in the match: 6 capital letters and digits, like PNR XK7P2Q.

rre.booking_reference(text)

\b(?i:(?:booking|reservation|confirmation)[ _-]?(?:ref(?:erence)?|code|number)|record[ _-]?locator|pnr|(?:boekings|reserverings|buchungs)(?:referen(?:tie|z)|code|nummer)|(?:r[ée]f[ée]rence|code) de r[ée]servation|localizador|c[óo]digo de reserva|codice(?: di)? prenotazione|kod rezerwacji|cod(?: de)? rezervare)(?i:[ _-]?n(?:o|r|umber))?\.?(?:"?\s?[:=#]\s?"?|\s)(?:(?i:is|lautet|est) )?(?=[A-Z\d]{0,5}[A-Z])[A-Z\d]{6}\b

container_number

Shipping container number (ISO 6346): a three-letter owner code, U, J or Z, six digits and a check digit, with or without spaces or hyphens, like CSQU3054383, CSQU 305438 3 or CSQU-305438-3.

rre.container_number(text)

\b[A-Za-z]{3}[UJZujz][\s-]?\d{6}\s?-?\d\b

Matches are checked with iso6346; one that fails it is dropped.

customs_mrn

Customs MRN (Movement Reference Number) of an EU import, export or transit declaration: two digits for the year, the issuing country (EU, Northern Ireland as XI, or a common transit country), 13 capitals and digits and a check digit (ISO 6346, as on containers), like 24BE000000123456J8.

rre.customs_mrn(text)

\b\d{2}(?:AT|B[EG]|C[HYZ]|D[EK]|E[ES]|F[IR]|G[BER]|H[RU]|I[EST]|L[TUV]|M[DEKT]|N[LO]|P[LT]|R[OS]|S[EIK]|TR|UA|XI)[A-Z0-9]{13}\d\b

Matches are checked with iso6346; one that fails it is dropped.

dhl_tracking_number

DHL tracking number (waybill, Sendungsnummer): JJD or JVGL codes, or after DHL, keyword included in the match, a 10-digit Express waybill or a 12- or 20-digit DHL Paket number, like DHL 1234567891.

rre.dhl_tracking_number(text)

\b(?:J(?:JD|VGL)\d{10,20}|(?i:dhl)\b[^\d\n]{0,30}\b(?:\d{20}|\d{12}|\d{2} ?\d{4} ?\d{4}))\b

Matches are checked with dhl; one that fails it is dropped.

dpd_tracking_number

DPD parcel number (Paketnummer, pakketnummer) after DPD, keyword included in the match: 14 digits, with or without spaces, and the check character printed after them if given, like DPD 0150 1234 5678 90 S.

rre.dpd_tracking_number(text)

\b(?i:dpd)\b[^\d\n]{0,30}\b\d{4} ?\d{4} ?\d{4} ?\d{2}(?: ?[0-9A-Za-z])?\b

Matches are checked with dpd; one that fails it is dropped.

fedex_tracking_number

FedEx tracking number after FedEx, keyword included in the match: a 12-digit Express number, a 15-digit Ground number or 22 digits starting with 96, with or without spaces, like FedEx 7489 1234 5679.

rre.fedex_tracking_number(text)

\b(?i:fedex)\b[^\d\n]{0,30}\b(?:96\d\d(?: ?\d{4}){4} ?\d\d|\d{4} ?\d{4} ?\d{4}(?: ?\d{3})?)(?! ?\d)

Matches are checked with fedex; one that fails it is dropped.

flight_number

Flight number after flight, Flug, vlucht, vol, vuelo, volo or zbor, keyword included in the match: an IATA airline code and 1 to 4 digits, like Flight LH 1234 or vlucht KL1702; a bare LH 1234 does not match.

rre.flight_number(text)

\b(?i:flights?|flug|vlucht|vuelo|volo|zbor|vol)(?i:[ _-]?(?:number|nummer|no|nr|n°))?\.?(?:"?\s?[:=#]\s?"?|\s)(?:[A-Z]\d|\d[A-Z]|[A-Z]{2})[ -]?\d{1,4}[A-Z]?\b

gls_tracking_number

GLS parcel number (Paketnummer, pakketnummer, numéro de colis) after GLS, keyword included in the match: 11 digits, or 12 with the check digit, like GLS 36631234567.

rre.gls_tracking_number(text)

\b(?i:gls)\b[^\d\n]{0,30}\b\d{11,12}\b

Matches are checked with gls; one that fails it is dropped.

imo_number

Ship IMO number after IMO, IMO: or IMO no. (capitals), keyword included in the match: seven digits whose last is the check digit, like IMO 9074729 or IMO: 9074729.

rre.imo_number(text)

\bIMO(?:[\s-]?(?i:no|nr|n°|number|nummer)\.?)?(?:\s?[:#]\s?|[\s-])?\d{7}\b

Matches are checked with imo; one that fails it is dropped.

mmsi

Ship radio identity (MMSI, as broadcast by AIS and DSC) after MMSI, keyword included in the match: nine digits of a ship, group, coast station, SAR aircraft, AIS aid or beacon, like MMSI 200123456.

rre.mmsi(text)

\b(?i:mmsi)(?:[\s-]?(?i:no|nr|n°|number|nummer)\.?)?\W{0,3}(?=\d{9}\b)(?:[2-7]|0{1,2}[2-7]|111[2-7]|8[2-7]|9[89][2-7]|97[024])\d+\b

seal_number

Container seal number after seal, zegel, scellé, plomb, Plombe, precinto, sigillo, ..., also with no. or number after it, keyword included in the match: 5 to 15 capitals, digits and hyphens with a digit, like Seal No.: ML-BE1234567.

rre.seal_number(text)

\b(?i:(?:container[ -]?)?seals?|zegel|scell[ée]s?|plomb(?:e|en|a)?|zollplombe|precinto|sigillo|sigiliu)(?:[ ._-]?(?i:no|nr|number|nummer|n°|num[eé]ro|#))?\.?(?:\s?[:#]\s?|\s)(?=[A-Z-]{0,15}\d)[A-Z0-9][A-Z0-9-]{3,13}[A-Z0-9]\b

un_number

Dangerous goods UN number (ADR, IMDG, IATA DGR): UN and four digits, like UN 1203 or UN1993, or after UN number, UN-Nummer or numéro ONU, keyword included; the UN 2030 Agenda does not match.

rre.un_number(text)

(?:\bUN[ -]?(?:[Nn]umber|[Nn]ummer|[Nn]o|[Nn]r|n°)\.?(?:\s?[:#]\s?|\s)|\b(?:[Nn]um[ée]ro|[Nn]°|[Nn]r\.?) ?ONU(?:\s?[:#]\s?|\s)|(?<![Tt]he )\bUN[ -]?)[0-3]\d{3}\b

ups_tracking_number

UPS tracking number: 1Z, 15 letters or digits and a check digit, with or without spaces, like 1Z999AA10123456784 or 1Z 999 AA1 01 2345 678 4.

rre.ups_tracking_number(text)

\b1Z(?: ?[A-Z\d]){15} ?\d\b

Matches are checked with ups_1z; one that fails it is dropped.

upu_tracking_number

International postal tracking number (UPU S10) of registered mail and parcels: two letters, nine digits and a country code, like RR123456785BE or AA 473 124 829 GB.

rre.upu_tracking_number(text)

\b[A-Z]{2} ?\d{3} ?\d{3} ?\d{3} ?[A-Z]{2}\b

Matches are checked with upu_s10; one that fails it is dropped.

usps_tracking_number

USPS tracking number (IMpb): 22 or 26 digits starting with 91 to 95, with or without spaces, like 9400 1123 4567 8901 2345 66, or 20 digits (Certified Mail) after USPS, keyword included in the match.

rre.usps_tracking_number(text)

\b(?:(?i:usps)\b[^\d\n]{0,30}\b(?:\d{4}(?: ?\d{4}){4}|9[1-5]\d\d(?: ?\d{4}){4,5} ?\d\d)|9[1-5]\d\d(?: ?\d{4}){4,5} ?\d\d)(?! ?\d)

Matches are checked with usps; one that fails it is dropped.

vin

Vehicle identification number (VIN, chassis number): 17 capital letters and digits without I, O or Q, with at least one letter and one digit, like 1M8GDM9AXKP042788; a SEPA creditor ID like BE81ZZZ0123456749 is not one.

rre.vin(text)

\b(?![A-Z]{2}\d\dZZZ)(?=[A-HJ-NPR-Z0-9]*\d)(?=[A-HJ-NPR-Z0-9]*[A-HJ-NPR-Z])[A-HJ-NPR-Z0-9]{17}\b

Products and publications

function checksum validator
rre.gtin gtin
rre.isbn isbn

gtin

Barcode number (EAN-8, UPC-A, EAN-13 or GTIN-14) after EAN, GTIN or UPC (also EAN-13, UPC-A, ...), keyword included in the match, like EAN 4006381333931.

rre.gtin(text)

\b(?i:(?:ean|gtin|upc)(?:-?(?:8|1[234]|a))?)(?:"?\s?:\s?"?|\s)\d(?:[ -]?\d){7,13}\b

Matches are checked with gtin; one that fails it is dropped.

isbn

Book number (ISBN-13 starting with 978 or 979, or ISBN-10) after ISBN, ISBN-10 or ISBN-13, keyword included in the match, with hyphens or spaces, like ISBN 978-0-306-40615-7.

rre.isbn(text)

\b(?i:isbn)(?:[- ]?1[03])?(?:"?\s?:\s?"?|\s)(?:97[89][- ]?(?:\d[- ]?){9}\d|(?:\d[- ]?){9}[\dXx])\b

Matches are checked with isbn; one that fails it is dropped.

Text

function checksum validator
rre.hex_color
rre.multiple_punctuation

hex_color

Hex color code #rrggbb or #rrggbbaa with at least one letter a-f; the short #rgb and #rgba only after :, =, a quote or (, as in CSS and HTML.

rre.hex_color(text)

(?i)(?<![\w&#])#(?=[0-9]*[a-f])(?:[0-9a-f]{6}(?:[0-9a-f]{2})?|(?:(?<=[:="'(]#)|(?<=: #))[0-9a-f]{3,4})(?![\w-])

multiple_punctuation

Two or more punctuation marks in a row, like ??, ?!, ... or &&&&&; a single mark does not match.

rre.multiple_punctuation(text)

[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]{2,}