piighost/uk-nino
UK National Insurance number: two letters from the allowed set, six digits, then a letter from A to D. The prefix classes exclude D, F, I, Q, U and V, which HMRC never issues, so the shape alone is already selective. One consequence worth knowing: HMRC's own example number QQ123456C is not matched, because Q is one of the excluded letters, which is exactly why HMRC publishes it.
Label: UK_NINO
Pattern \b[A-CEGHJ-PR-TW-Z]{2}\d{6}[A-D]\b
Must be caught NI number AB123456C on the payslip. → AB123456CReference AB654321A recorded. → AB654321A
Must be left alone DA123456CQQ123456CAB123456Z
Tags: uk, government-id, identity, hr
Download the detector as TOML
Used by
piighost/uk — the United Kingdom: phone, postcode, the National Insurance number, the NHS number and the VAT registration number.
Related patterns
piighost/ar-dni — Argentine national identity document number, the DNI: eight digits, written solid or with a period after the second…
piighost/at-svnr — Austrian social security number, the Sozialversicherungsnummer: ten digits, a three digit serial and one check digit,…
piighost/au-driving-licence — Australian driver licence number.
piighost/au-medicare — Australian Medicare number: ten digits in the groups the card prints, sometimes followed by the individual reference…
piighost/au-passport — Australian passport number, eight or nine characters, per the Purview Australia passport definition: one letter from…
piighost/be-nrn — Belgian national register number in its written form: the birth date in dotted pairs, a dash, a three digit sequence…
← piighost/uk-nhs · All patterns in the catalogue · piighost/uk-passport →