File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -90,9 +90,11 @@ def deidentify(file_name, project_id):
90
90
# Currently social security numbers and credit card numbers
91
91
# are interpreted as phone numbers
92
92
93
- regex = (r".([A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`"
94
- r"{|}~-]+)*)(\sat\s+)((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+"
95
- r"[a-z0-9](?:[a-z0-9-]*[a-z0-9]))" )
93
+ regex = (
94
+ r".([A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`"
95
+ r"{|}~-]+)*)(\sat\s+)((?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+"
96
+ r"[a-z0-9](?:[a-z0-9-]*[a-z0-9]))"
97
+ )
96
98
97
99
updated_transcript = re .sub (regex , r" \1@\3" , transcript )
98
100
@@ -108,7 +110,7 @@ def deidentify(file_name, project_id):
108
110
109
111
# Print out the results.
110
112
print ('Final Result with sensitive content redacted: {}'
111
- .format (dlp_response .item .value ))
113
+ .format (dlp_response .item .value ))
112
114
# [END dlp_deidentify_masking]
113
115
114
116
You can’t perform that action at this time.
0 commit comments