Skip to content

Commit

Permalink
Update PIIDetector.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
reddyashish committed Apr 16, 2024
1 parent b033ec0 commit 6635781
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/DynamoUtilities/PIIDetector.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;

namespace Dynamo.Utilities
{
Expand Down Expand Up @@ -119,13 +118,16 @@ public static JToken GetNoteValue(JObject jsonWorkspace, string nodeId)
internal static string RemovePIIData(string data)
{
string result;

// ToDo: some of the regex patterns are interfering with other data in the json,
// so commenting them for now and will address those patterns later.
result = Regex.Replace(data, emailPattern, "");
result = Regex.Replace(result, websitePattern, "");
result = Regex.Replace(result, directoryPattern, "");
result = Regex.Replace(result, creditCardPattern, "");
result = Regex.Replace(result, ssnPattern, "");
result = Regex.Replace(result, ipPattern, "");
result = Regex.Replace(result, datePattern, "");
//result = Regex.Replace(result, websitePattern, "");
//result = Regex.Replace(result, creditCardPattern, "");
//result = Regex.Replace(result, ipPattern, "");

return result;
}
Expand Down

0 comments on commit 6635781

Please sign in to comment.