, . , . Regex "", ( ). , . , , , .
string[] keywords = { "ac", "bd", "cd" };
string[] tosearch = { "abcdef" };
string pattern = String.Join("|", keywords);
Regex regex = new Regex(pattern, RegexOptions.Compiled);
foundAny = regex.IsMatch(String.Join("|", tosearch));
Also note that this works as long as your keywords do not contain special regular expression characters (and the search strings do not contain a pipe character. However, special characters can be overcome using escape sequences and search strings should not be combined, as i did.
source
share