Belgian regexes¶
Python regexes for Belgian identifiers, with checksum validation: national and BIS number, enterprise and VAT number, IBAN, OGM, eID, plates and phones.
39 regexes, from regular_regexes/be/regexes.json, called as rre.be.<name>(text).
Personal numbers (2) · Identity documents (5) · Companies and tax (4) · Banking and payments (6) · Phones and SIM cards (6) · Web and network (1) · Dates and times (4) · Places and addresses (4) · Vehicles, ships and parcels (3) · Justice and police (4)
Personal numbers¶
| function | checksum validator |
|---|---|
rre.be.bis_number |
be_bis_number |
rre.be.national_number |
be_national_number |
bis_number¶
Belgian BIS number (bisnummer, numéro bis): 11 digits written like the national number, 85.27.30-033.71 or without dots and dash, with the birth month raised by 20 or 40.
rre.be.bis_number(text)
\b\d{2}\.?\d{2}\.?\d{2}-?\d{3}\.?\d{2}\b
Matches are checked with be_bis_number; one that fails it is dropped.
national_number¶
Belgian national register number (rijksregisternummer, numéro de registre national): 11 digits, birth date first (month 00 to 12), like 85.07.30-033.28 or 85073003328.
rre.be.national_number(text)
\b\d{2}\.?(?:0\d|1[0-2])\.?(?:[0-2]\d|3[01])-?\d{3}\.?\d{2}\b
Matches are checked with be_national_number; one that fails it is dropped.
Identity documents¶
| function | checksum validator |
|---|---|
rre.be.driving_licence_number |
|
rre.be.eid_card_number |
mod97 |
rre.be.mrz_id_card |
mrz_td1 |
rre.be.mrz_passport |
mrz_td3 |
rre.be.passport_number |
driving_licence_number¶
Belgian driving licence number (rijbewijsnummer, numéro de permis de conduire): the 10 digits after their label, keyword included, like rijbewijs nr. 0123456789.
rre.be.driving_licence_number(text)
(?i:\b(?:rijbewijs(?:nummer|nr\b\.?)?|(?:num[ée]ro\s(?:de\s|du\s)?)?permis\sde\sconduire|f(?:ü|ue?)hrerschein(?:nummer|-?nr\b\.?)?|driv(?:ing|ers?|er['’]s)\slicen[cs]e(?:\snumber)?)(?:\s?(?:n[°º]|nr|no|nummer|number)\.?)?)\s?[:#]?\s?\d{10}\b
eid_card_number¶
Belgian eID card number (kaartnummer van de identiteitskaart, numéro de carte d'identité): 12 digits, written 592-1234567-32 or without the dashes.
rre.be.eid_card_number(text)
(?<!\d-)\b\d{3}-?\d{7}-?\d{2}\b(?!-\d)
Matches are checked with mod97; one that fails it is dropped.
mrz_id_card¶
Machine-readable zone (MRZ) of a Belgian identity card, first line (ICAO TD1): 30 characters with BEL as issuing country, like IDBEL592123456<782<<<<<<<<<<<<.
rre.be.mrz_id_card(text)
(?<![A-Z0-9<])[IAC][A-Z<]BEL[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 Belgian passport, second line (ICAO TD3): 44 characters with the passport number, BEL as nationality, date of birth, sex and expiry date.
rre.be.mrz_passport(text)
(?<![A-Z0-9<])[A-Z0-9<]{9}\dBEL\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.
passport_number¶
Belgian passport number (paspoortnummer, numéro de passeport): two capital letters and six digits, like EH123456.
rre.be.passport_number(text)
\b[A-Z]{2}\d{6}\b
Companies and tax¶
| function | checksum validator |
|---|---|
rre.be.company_name |
|
rre.be.enterprise_number |
be_enterprise_number |
rre.be.establishment_number |
be_enterprise_number |
rre.be.vat_number |
be_enterprise_number |
company_name¶
Belgian company name: up to nine capitalized words on one line followed by a legal form (BV, BVBA, NV, CV, CVBA, VZW, VOF, CommV, SRL, SPRL, SA, SC, ASBL, SNC), like Janssens Bouw BV; not across a sentence's full stop, and not Uw CV or votre CV (a curriculum vitae).
rre.be.company_name(text)
\b[A-Z][\w&'.-]{0,40}(?:(?<!\w\w\.) (?:[A-Z0-9][\w&'.-]{0,40}|&)){0,8}(?<!\w\w\.) (?:BV|BVBA|NV|(?<!\b(?:Uw|Je|My) )(?<!\b(?:Mon|Ton|Son|His|Her|Our) )(?<!\b(?:Mijn|Jouw|Zijn|Haar|Your|Leur) )(?<!\b(?:Votre|Notre|Their) )CV|CVBA|VZW|VOF|CommV|SRL|SPRL|SA|SC|ASBL|SNC)\b
enterprise_number¶
Belgian enterprise number (ondernemingsnummer, numéro d'entreprise, KBO/BCE): 10 digits starting with 0 or 1, with or without dots, like 0123.456.749.
rre.be.enterprise_number(text)
\b[01]\d{3}\.?\d{3}\.?\d{3}\b
Matches are checked with be_enterprise_number; one that fails it is dropped.
establishment_number¶
Belgian establishment unit number (vestigingseenheidsnummer, numéro d'unité d'établissement): 10 digits starting with 2 to 8, like 2.123.456.791.
rre.be.establishment_number(text)
\b[2-8]\.?\d{3}\.?\d{3}\.?\d{3}\b
Matches are checked with be_enterprise_number; one that fails it is dropped.
vat_number¶
Belgian VAT number (btw-nummer, numéro de TVA): BE and the 10-digit enterprise number, with or without a space and dots, like BE0123.456.749.
rre.be.vat_number(text)
\bBE\s?[01]\d{3}\.?\d{3}\.?\d{3}\b
Matches are checked with be_enterprise_number; one that fails it is dropped.
Banking and payments¶
| function | checksum validator |
|---|---|
rre.be.amount_eur |
|
rre.be.bancontact_card |
luhn |
rre.be.bban |
mod97 |
rre.be.bic |
|
rre.be.iban |
iban |
rre.be.structured_communication |
mod97 |
amount_eur¶
Amount in euros, written the Belgian way: € before it, or €, EUR or euro(s) after it in any case, the thousands split by dots or by spaces (the same throughout), and a comma before the cents or ,-, like € 1.234,56, 1 249,99 euros or 250 EUR.
rre.be.amount_eur(text)
€\s?(?:\d{1,3}(?:\.\d{3}){1,4}|\d{1,3}(?:[ \u00a0\u202f]\d{3}){1,4}|\d+)(?:,\d{2}|,-)?(?![.,]?\d)|(?<![\w.,])(?:\d{1,3}(?:\.\d{3}){1,4}|\d{1,3}(?:[ \u00a0\u202f]\d{3}){1,4}|\d+)(?:,\d{2}|,-)?\s?(?:€|(?i:eur|euros?)\b)
bancontact_card¶
Bancontact card number (Belgian debit card, bankkaart): 17 digits starting with 6703, with or without spaces or dashes, like 6703 1234 5678 9012 1.
rre.be.bancontact_card(text)
\b6703(?:[ -]?\d){13}\b
Matches are checked with luhn; one that fails it is dropped.
bban¶
Old Belgian bank account number (BBAN, rekeningnummer, numéro de compte) from before IBAN: 12 digits written 539-0075470-34, with both dashes.
rre.be.bban(text)
(?<!\d-)\b\d{3}-\d{7}-\d{2}\b(?!-\d)
Matches are checked with mod97; one that fails it is dropped.
bic¶
BIC (SWIFT code) of a Belgian bank: four letters, BE and a two-character location code with a B or a digit in it (BB, 22, B1), with an optional three-character branch code, like GEBABEBB or KREDBEBBXXX.
rre.be.bic(text)
\b[A-Z]{4}BE(?=[A-Z0-9]?[B\d])[A-Z0-9]{2}(?:[A-Z0-9]{3})?\b
iban¶
Belgian IBAN: BE, two check digits and 12 digits, with or without spaces, like BE68 5390 0754 7034.
rre.be.iban(text)
\bBE\d{2}(?: ?\d{4}){3}\b
Matches are checked with iban; one that fails it is dropped.
structured_communication¶
Belgian structured payment reference (gestructureerde mededeling, communication structurée, OGM/VCS): 12 digits as +++123/4567/89002+++, or with *** at both ends.
rre.be.structured_communication(text)
(\+{3}|\*{3})\d{3}/\d{4}/\d{5}\1
Matches are checked with mod97; one that fails it is dropped.
Phones and SIM cards¶
| function | checksum validator |
|---|---|
rre.be.iccid |
luhn |
rre.be.imsi |
|
rre.be.mobile_number |
phone |
rre.be.msisdn |
phone |
rre.be.phone_number |
phone |
rre.be.premium_number |
phone |
iccid¶
SIM card number (ICCID) of a Belgian SIM: 8932 followed by 14 to 16 digits, without spaces, like 89320112345678901232.
rre.be.iccid(text)
\b8932\d{14,16}\b
Matches are checked with luhn; one that fails it is dropped.
imsi¶
IMSI (subscriber identity on a SIM) of a Belgian network: mobile country code 206 and 12 more digits, 15 in all, like 206011234567890.
rre.be.imsi(text)
\b206\d{12}\b
mobile_number¶
Belgian mobile number (gsm-nummer): 04xx, +32 4xx or 0032 4xx (also +32 (0)4xx) and six digits, with spaces, dots or slashes or none, like 0470 12 34 56; only valid Belgian mobile numbers, not part of a longer run of digit groups.
rre.be.mobile_number(text)
(?<!\d[ ./])(?:(?:\+|\b00)32(?:\s?\(0\))?|\b0)\s?4[5-9]\d(?:[\s./]?\d){6}\b(?![ ./]?\d)
Matches are checked with phone (regions BE, kind mobile); one that fails it is dropped.
msisdn¶
Belgian mobile number in MSISDN form, as in telecom records: 32 and the number without its 0 and without a +, 11 digits like 32470123456; only valid Belgian mobile numbers.
rre.be.msisdn(text)
(?<!\+)\b324[5-9]\d{7}\b
Matches are checked with phone (regions BE, kind msisdn); one that fails it is dropped.
phone_number¶
Belgian phone number, landline or mobile: 0, +32 or 0032 (also +32 (0)) and 8 or 9 digits, with spaces, dots or slashes or none, like 02/234.56.78; only valid Belgian numbers, not part of a longer run of digit groups.
rre.be.phone_number(text)
(?<!\d[ ./])(?:(?:\+|\b00)32(?:\s?\(0\))?|\b0)\s?[1-9](?:[\s./]?\d){7,8}\b(?![ ./]?\d)
Matches are checked with phone (regions BE); one that fails it is dropped.
premium_number¶
Belgian premium-rate (090x) or shared-cost (070) number, with or without spaces, dots or slashes, like 0900 12 345 or 070 22 33 44; only valid Belgian numbers.
rre.be.premium_number(text)
(?<!\d[ ./])\b0(?:70|90\d)(?:[\s./]?\d){5,6}\b(?![ ./]?\d)
Matches are checked with phone (regions BE, kind premium); one that fails it is dropped.
Web and network¶
| function | checksum validator |
|---|---|
rre.be.domain_be |
domain_be¶
Belgian domain name ending in .be, .brussels, .vlaanderen or .gent, in any case, with its subdomains, like www.politie.be or stad.brussels; email addresses like jan@test.be and longer names like test.be.com do not match.
rre.be.domain_be(text)
(?<![\w@])(?<!\w[.-])\b[\w-]+(?:\.[\w-]+)*\.(?i:be|brussels|vlaanderen|gent)\b(?![\w.+-]{0,64}@)(?!-|\.[\w-])
Dates and times¶
| function | checksum validator |
|---|---|
rre.be.birth_date |
|
rre.be.date_numeric |
|
rre.be.date_text |
|
rre.be.time |
birth_date¶
Date of birth with its marker, marker included: °, geboren (te Gent) op, geb. (am), né(e) (à Liège) le, born on, geboortedatum, date de naissance, DOB, then a date like ° 3/2/1990.
rre.be.birth_date(text)
(?i)(?:(?<![\w°])°|\b(?:geboortedatum|geboren|geb\.|née?(?:\(e\))?|born|geburtsdatum|date\s(?:de\snaissance|of\sbirth)|dob))(?:,?\s(?:te|in|à)(?:\s(?:(?-i:[A-ZÀ-Ý])[\w'’-]*|\([^()\n]{1,30}\))){1,3})?(?:,?\s(?:op|le|am|on))?\s?:?\s?(?P<date>(?:0?[1-9]|[12]\d|3[01])(?:([/.-])(?:0?[1-9]|1[0-2])\2\d\d(?:\d\d)?|(?:er|\.)?\s(?:jan|f[eé]|m[aäe]|a[puvo]|ju|sep|o[ck]t|nov|d[eé][cz])[^\W\d]{0,6}\s\d{4})\b)
date_numeric¶
Date with the day first, the Belgian way: day, month and a 2- or 4-digit year separated by the same /, . or -, like 12/01/2024 or 3.2.24; not inside a longer run of numbers such as 06.12.34.56.78.
rre.be.date_numeric(text)
(?<!\d[/.-])\b(?:0?[1-9]|[12]\d|3[01])([/.-])(?:0?[1-9]|1[0-2])\1(?:\d{4}|\d{2})\b(?![/.-]\d)
date_text¶
Date with the month written out in Dutch, French or German, in any case and also without its accent (fevrier, Maerz), like 12 januari 2024, 1er mars 2023 or 3. März 2022.
rre.be.date_text(text)
(?i)\b(?:0?[1-9]|[12]\d|3[01])(?:er|\.)?\s(?:januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december|janvier|f[ée]vrier|mars|avril|mai|juin|juillet|ao[uû]t|septembre|octobre|novembre|d[ée]cembre|januar|februar|m(?:ä|ae)rz|august|oktober|dezember)\s\d{4}\b
time¶
Time of day as written in Belgium: hour 0 to 23 and minutes with u, h (either case) or : in between, and seconds if given, like 14u30, 9h05 or 23:59:30; not a part of a MAC or IPv6 address.
rre.be.time(text)
(?<![\da-fA-F:]{2}:)\b(?:[01]?\d|2[0-3])[uUhH:][0-5]\d(?::[0-5]\d)?\b(?!:[\da-fA-F])
Places and addresses¶
| function | checksum validator |
|---|---|
rre.be.postal_code_city |
|
rre.be.quay |
|
rre.be.street_address_fr |
|
rre.be.street_address_nl |
postal_code_city¶
Belgian postal code (postcode, code postal) and municipality on the same line: four digits and one or more capitalized words, or a name in capitals, like 9000 Gent, 9100 Sint-Niklaas or 1000 BRUXELLES; not a Dutch postcode like 1234 AB.
rre.be.postal_code_city(text)
(?<!\b[AC-Z]-)\b[1-9]\d{3} (?!(?:EUR|USD|GBP|CHF|RON|LEI|PLN|Euros?|Lei)\b)(?:[A-ZÀ-Ý][a-zà-ÿ][\w'-]*|(?=[A-ZÀ-Ý'-]*[AEIOU])[A-ZÀ-Ý][A-ZÀ-Ý'-]{2,}\b)(?: (?:[A-ZÀ-Ý][a-zà-ÿ][\w'-]*|(?=[A-ZÀ-Ý'-]*[AEIOU])[A-ZÀ-Ý][A-ZÀ-Ý'-]{2,}\b))*
quay¶
Quay (berth) number in a Belgian port after kaai, quai, quay, berth or ligplaats, keyword included in the match, like Kaai 913 or quai 1742; Antwerp's terminals are known by their quay.
rre.be.quay(text)
\b(?i:kaai(?:nummer)?|quai|quay|berth|ligplaats)(?:\s?(?i:nr|no|n°)\.?)?\s?[1-9]\d{0,3}\b
street_address_fr¶
Street address in French: Rue, Avenue (Av.), Chaussée, Place, Boulevard (Bd), Chemin, Quai or Square, the name and a house number of up to four digits, with the box (bte) if given, like Rue de la Loi 16 bte 2.
rre.be.street_address_fr(text)
\b(?:Rue|Avenue|Av\.|Chaussée|Place|Boulevard|Bd\.?|Chemin|Quai|Square)\s[\w'’ -]{1,60}?\s\d{1,4}[a-zA-Z]?\b(?:\s(?:bte|boîte|bt\.)\s?\w+)?
street_address_nl¶
Street address in Dutch: a name ending in straat, laan, steenweg, plein, lei, dreef, weg, baan, kaai or markt, a house number of up to four digits and the box (bus) if given, like Kerkstraat 12 bus 3.
rre.be.street_address_nl(text)
\b[A-Z][\w'-]{0,40}(?:straat|laan|steenweg|plein|lei|dreef|weg|baan|kaai|markt)\s\d{1,4}[a-zA-Z]?\b(?:\s(?:bus|b\.)\s?\w+)?
Vehicles, ships and parcels¶
| function | checksum validator |
|---|---|
rre.be.aircraft_registration |
|
rre.be.bpost_tracking_number |
|
rre.be.license_plate |
aircraft_registration¶
Belgian aircraft registration: OO- and three letters, like OO-SNA, or the forms for microlights (OO-I36), paramotors (OO-1AB) and home-built aircraft (OO-123).
rre.be.aircraft_registration(text)
\bOO-(?:[A-Z]{3}|[A-Z]\d\d|[1-9][A-Z]{2}|\d{2,3})\b
bpost_tracking_number¶
bpost parcel barcode (track-and-trace number, code de suivi): 24 digits starting with 3232 or 3299, 18 digits starting with 3232, or JJBEA and 22 digits, like 323256984521032569.
rre.be.bpost_tracking_number(text)
\b(?:32(?:32|99)\d{20}|3232\d{14}|JJBEA\d{22})\b
license_plate¶
Belgian license plate (nummerplaat, plaque d'immatriculation): 1-ABC-123 since 2010, with or without dashes, and the older ABC-123 and 123-ABC with their dash.
rre.be.license_plate(text)
\b(?<!\w-)(?:[1-9]-?[A-Z]{3}-?\d{3}|[A-Z]{3}-\d{3}|\d{3}-[A-Z]{3})\b(?!-\w)
Justice and police¶
| function | checksum validator |
|---|---|
rre.be.docket_number |
|
rre.be.ecli |
|
rre.be.notice_number |
|
rre.be.pv_number |
docket_number¶
Belgian court docket number (rolnummer, numéro de rôle), label included if any: 2026/AR/1234 or 2026/AB/123 (appeal and labour courts), Cassation's P.24.0123.N, and after AR, R.G. or rolnummer AR 26/1234/A.
rre.be.docket_number(text)
((?:\b(?:A\.?R|R\.?G)\b\.?|(?i:\brol(?:nummer|\s?nr\b\.?)|\b(?:num[ée]ro|n[°º])\sd[ue]\sr[ôo]le))\s?(?:(?i:n[°º]|nr|no)\.?\s?)?:?\s?)?\b(?:(?:19|20)\d{2}/(?:A[ABGLMR]|CO|NT|RG)/\d{1,5}|\d{2}/CAS/\d{1,5}|[CDFPS]\.\d{2}\.\d{4}\.[NFD]|(?(1)(?:(?:19|20)?\d{2}/(?:\d{1,6}/[A-Z]{1,2}|[A-Z]{1,3}/\d{1,6})|[A-Z]/\d{2}/\d{1,6}|\d{2}[A-Z]\d{1,7})|(?!)))\b
ecli¶
European Case Law Identifier (ECLI) of a Belgian court decision: ECLI:BE:, the court, the year and the number, like ECLI:BE:CASS:2020:ARR.20200115.1.
rre.be.ecli(text)
\bECLI:BE:[A-Z]+:\d{4}:[A-Z0-9.]*[A-Z0-9](?!\.?\w)
notice_number¶
Belgian prosecutor's file number (notitienummer, numéro de notice) after its label, keyword included: the PV number's form, like Notitienummer: AN55.L1.012345/26, or a slash form like GE/D/43/12/1234/2024.
rre.be.notice_number(text)
(?i:\b(?:notitie(?:nummer|\s?nr\b\.?)?|not\.\s?nr\b\.?|num[ée]ro\sde\snotice|n[°º]\s?(?:de\s)?notice|notice(?:\s(?:n[°º]|nr\b\.?|number))?)(?:\s(?:van\shet\s)?parket(?:-generaal)?|\sdu\sparquet)?)\s?:?\s?(?:[A-Z]{2}(?:\. ?| )?\d{2} ?\. ?[A-Z][A-Z0-9] ?\. ?\d{3,7}[/-](?:(?:19|20)\d{2}|\d{2})|[A-Z]{2}/[A-Z]/\d{2}/[A-Z0-9]{2}/\d{1,7}/(?:19|20)\d{2})\b
pv_number¶
Belgian police report number (pv-nummer, numéro de PV), also the notitienummer of the case it opens: parket code, offence code, police unit, number and year, like AN.55.LB.000123/2026 or HA55.L1.012345/16.
rre.be.pv_number(text)
\b[A-Z]{2}(?:\. ?| )?\d{2} ?\. ?[A-Z][A-Z0-9] ?\. ?\d{3,7}[/-](?:(?:19|20)\d{2}|\d{2})\b