college/Summer-2024/CS-3424/Assignments/Assignment-2/src/assign2.sed

19 lines
652 B
Sed
Raw Normal View History

2024-07-14 17:44:41 -05:00
# Redact Driver's License numbers
s/[a-zA-Z]{2}\s?DL [0-9]{6,8}/DL <redacted>/g
# Redact Credit Card Numbers
## Visa Cards
s/4[0-9]{3}-?[0-9]{4}-?[0-9]{4}-?([0-9]{4})/VISA-\1/g
## Master Cards
s/5[0-9]{3}-?[0-9]{4}-?[0-9]{4}-?([0-9]{4})/MC-\1/g
## Discover Cards
s/6[0-9]{3}-?[0-9]{4}-?[0-9]{4}-?([0-9]{4})/DISC-\1/g
## Amex Cards (Important that it comes last because it collides inside larger card lengths)
s/3[47][0-9]{2}-?[0-9]{6}-?[0-9]([0-9]{4})/AMEX-\1/g
# Redact license plates
s/TX\s?[[:alnum:]]{3}-?([[:digit:]]{4}|[[:alnum:]]{3})/TX <redacted>/g
# Template in the municipality name
s/(<mname>|<muname>)/City of Brook Haven, Connecticut/g