Hi, is it correct that you only want to know if one of these words occur without actually knowing the word it concerns? In that case matching "confidential" is enough for matching both "confidential" and "co-confidential".
If you need to know exactly which words occur in the document you can use regex (fast), but you can also use a simply split on the text. Something like:
var keywords = new List<string> {"secret", "restricted", "confidential", "co-confidential"};
var words = documentText.Split(' ');
var hits = new Dictionary<string, int>();
foreach (var word in words) {
var keyword = word.Trim('.', ',', '!', '?');
if (keywords.Contains(keyword)
if (hits.ContainsKey(keyword))
hits[keyword]++;
else
hits.Add(keyword, 1);
}
HTH