piighost/ca-driving-licence

Canadian driver licence number, which varies by province. Four of the provincial layouts that Purview documents are covered, all of them letter led: Ontario, a letter, four digits, five digits and five more digits with two constrained positions, hyphens optional; Quebec, a letter and twelve digits; Nova Scotia, five letters and nine digits with a constrained head; Newfoundland and Labrador, a letter and nine digits. The purely numeric provinces, British Columbia at seven digits, Saskatchewan at eight and Alberta at five to nine, are left out because a bare digit run of that length is indistinguishable from any other number. Reproduced noise: inside the hyphenated Ontario form the five digit groups are separately matched by FR_ZIP, DE_ZIP, ES_POSTAL, IT_CAP and US_ZIP, and the nine digit tail of the Nova Scotia form is separately matched by NL_BSN and US_BANK_ROUTING.

Label: CA_DRIVING_LICENCE

Pattern

(?<!\w)(?:[A-Z]\d{4}-?\d{5}-?\d[0156]\d[0-3]\d|[A-Z]\d{12}|[A-Z]{5}-?[0-3]\d[01]\d{6}|[A-Z]\d{9})(?!\w)

Must be caught

Must be left alone

Tags: ca, government-id, identity

Download the detector as TOML