I’ve got a system in C# where by a set of keywords are required. Two fields have to be checked if the keywords exist.
Initially I wrote a foreach loop to go through each keyword, then cycle through the results and check. However, this is somewhat inefficient, as on check, I would like to see if any of the keywords exist in a given string, rather than one by one.
Thanks.
((keyword1)|(keyword2)|(keyword3))
Im not sure exactly how c# does regex but this should match and return matches.
You can test regexes here