piighost/in-passport

Indian passport number, eight characters: one letter, then seven digits of which the first and the last are never zero, with the single space that the booklet sometimes prints after the third character tolerated. Taken from the Presidio Indian passport recognizer; Google Cloud DLP carries the same infoType without publishing a layout. The two non zero constraints trim a useful slice of the false positives. Reproduced noise: when the space is present the five digit tail is separately matched by FR_ZIP, DE_ZIP, ES_POSTAL, IT_CAP and US_ZIP.

Label: IN_PASSPORT

Pattern

(?<!\w)[A-Z][1-9]\d ?\d{4}[1-9](?!\w)

Must be caught

Must be left alone

Tags: in, government-id, identity

Download the detector as TOML