- It uses regex to detect pii
- The regex code is in utils.ts
- The detection code is in detetion.ts
- The file data.ts is used for dummy data
tsc detection.ts --resolveJsonModule
node detection.js
PII Name | Regex | Source | Is modified |
---|---|---|---|
Name | ^[a-zA-Z\\s'-]+$ | LINK | YES |
Indian Phone Number | ^(?:\+91\\0)?[6789]\\d{9}$ | LINK | YES |
Bank Account Number | ^\d{18}$ | LINK | NO |
Credit Card Number | LINK | NO | |
User Email | [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ | LINK | YES |
Address | ^(\d{1,}) [a-zA-Z0-9\s]+(\,)? [a-zA-Z]+(\,)? [A-Z]{2} [0-9]{5,6}$ | LINK | NO |
IP Address | LINK | NO | |
MAC Address | LINK | NO | |
IMSI | ^[0-9]{5,15} | LINK | NO |
PAN CARD | [A-Z]{5}[0-9]{4}[A-Z]{1} | LINK | NO |
Debit Card | LINK | NO | |
Browser Name | LINK | NO | |
OS name | LINK | YES | |
Date | \d{1,2}\/\d{1,2}\/\d{2,4} | LINK | YES |
Zip code | ^[0-9]{5}(?:-[0-9]{4})?$ | LINK | NO |
SSN | LINK | NO | |
International Driving License | LINK | YES | |
Gender | LINK | NO | |
International Passport number | LINK | NO | |
Financial information | LINK | YES | |
Geolocation (Latitude) | LINK | NO | |
Geolocation (Longitude) | LINK | NO | |
URL | LINK | NO | |
Indian Vehicle Registration Number | LINK | NO | |
IMEI | \d{2}-\d{6}-\d{6}-\d{2} | LINK | NO |
Addhar Card | ^d{4}sd{4}sd{4}$ | LINK | YES |
International Phone Number | LINK | NO |