Regex.Match whole words

You should add the word delimiter to your regex:

\b(shoes|shirt|pants)\b

In code:

Regex.Match(content, @"\b(shoes|shirt|pants)\b");

Leave a Comment