private List <AnonymizedData> GetAnonymizedData(string segmentText) { var anonymizedData = new List <AnonymizedData>(); foreach (var pattern in _patterns) { var regex = DecryptIfEncrypted(pattern); var matches = regex.Matches(segmentText); foreach (Match match in matches) { if (match.Value.Length > 0) { var data = new AnonymizedData { MatchText = match.Value, PositionInOriginalText = match.Index, EncryptedText = AnonymizeData.EncryptData(match.ToString(), _encryptionKey) }; anonymizedData.Add(data); } } } return(anonymizedData); }
private List <AnonymizedData> GetAnonymizedData(string segmentText) { var anonymizedData = new List <AnonymizedData>(); foreach (var pattern in _patterns) { var regex = new Regex(pattern, RegexOptions.IgnoreCase); var matches = regex.Matches(segmentText); foreach (Match match in matches) { var data = new AnonymizedData { MatchText = match.Value, PositionInOriginalText = match.Index, EncryptedText = AnonymizeData.EncryptData(match.ToString(), "Andrea") }; anonymizedData.Add(data); } } return(anonymizedData); }