import { PiiPattern } from './types.js'; export const defaultPatterns: PiiPattern[] = [ { name: 'address_en', regex: /\b[\d-]+[\s-]+[A-Z-]+[\s-]+(?:street|st|avenue|ave|road|rd|boulevard|blvd|drive|dr|lane|ln|court|ct|place|pl|way|crescent|cres|circle|cir|parkway|pkwy|terrace|ter|square|sq|trail|trl|close|cl|grove|grv|heights|hts|hill|park|gardens|gdns|manor|mnr|estates|est|valley|vly|view|vw|point|pt|ridge|rdg|bay|cove|cv|mews|row|common|green|grn|landing|lndg|crossing|xing|glen|gln|meadow|mdw|pass|run|bend|curve|curv|fork|frk|gap|hollow|holw|knoll|knl|lock|lck|mill|ml|orchard|orch|path|pth|pine|pne|pond|shoal|shl|shore|shr|spring|spg|summit|smt|trace|trce|track|trak|turnpike|tpke|walk|wlk|woods|wds|private|prv)\b/gi, description: 'Address (English)', }, { name: 'address_fr', regex: /\b[\d-]+[\s-]+(?:rue|rte|avenue|av|boulevard|bd|chemin|ch|route|allée|all|place|pl|voie|v|carré|carre|impasse|imp|quai|qai|passage|pass)\.?[\s-]+(?:des|de\sla|du|d')?[\s-]?[A-ZÀÂÄÇÉÈÊËÎÏÔÖÙÛÜŸ-]+\b/gi, description: 'Address (French)', }, { name: 'api_key_gc_notify', regex: /\bgcntfy-[A-Z0-9-_]+-[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\b/gi, description: 'API key (GC Notify)', }, { name: 'bank_account_canada', regex: /\b\d{5}[-_.\s]{1}\d{3}[-_.\s]{1}\d{7,12}\b/g, description: 'Bank account number (Canada)', }, { name: 'credit_card', regex: /\b(?:\d{4}[-_.\s]?){3}\d{3,4}\b/g, description: 'Credit card number', }, { name: 'drivers_license_alberta', regex: /\b\d{6}[-_.\s]{1}\d{3}\b/gi, description: 'Alberta drivers license', }, { name: 'drivers_license_manitoba', regex: /\b(?:[A-Z]{2}[-_.\s]{1}){3}[A-Z]{1}\d{3}[A-Z]{2}\b/gi, description: 'Manitoba drivers license', }, { name: 'drivers_license_newfoundland', regex: /\b[A-Z]{1}\d{9}\b/gi, description: 'Newfoundland drivers license', }, { name: 'drivers_license_nova_scotia', regex: /\b[A-Z\s]{1,5}[-_.]?\d{9}\b/gi, description: 'Nova Scotia drivers license', }, { name: 'drivers_license_ontario', regex: /\b[A-Z]\d{4}[-_.\s]?\d{5}[-_.\s]?\d{5}\b/gi, description: 'Ontario drivers license', }, { name: 'drivers_license_quebec', regex: /\b[A-Z]\d{4}[-_.\s]?\d{6}[-_.\s]?\d{2}\b/gi, description: 'Quebec drivers license', }, { name: 'health_card_alberta', regex: /\b\d{5}[-_.\s]{1}\d{4}\b/gi, description: 'Alberta health card', }, { name: 'health_card_newfoundland', regex: /\b(?:\d{3}[-_.\s]{1}){3}\d{3}\b/gi, description: 'Newfoundland health card', }, { name: 'health_card_nova_scotia', regex: /\b\d{4}[-_.\s]{1}\d{3}[-_.\s]{1}\d{3}\b/gi, description: 'Nova Scotia health card', }, { name: 'health_card_nwt', regex: /\b[A-Z]\d{7}\b/gi, description: 'Northwest Territories health card', }, { name: 'health_card_ontario', regex: /\b\d{4}[-_.\s]?\d{3}[-_.\s]?\d{3}[-_.\s]?[A-Z]{1,2}\b/g, description: 'Ontario health card', }, { name: 'health_card_quebec', regex: /\b[A-Z]{4}[-_.\s]?\d{4}[-_.\s]?\d{4}\b/g, description: 'Quebec health card', }, { name: 'ip_address', regex: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g, description: 'IP address', }, { name: 'passport_canada', regex: /\b([A-Z]{2}[-_.\s]?\d{6})\b/g, description: 'Canadian passport', }, { name: 'phone_number', regex: /(?