title: C# Regex match multiple words in a string
body: <p>How can I find all the matches in a string using a regular expression run in C#?</p>
  
  <p>I want to find all matches in the below example string.
  Example:</p>
  
  <pre><code>inputString: Hello (mail) byebye (time) how are you (mail) how are you (time)
  </code></pre>
  
  <p>I want to match <code>(mail)</code> and <code>(time)</code> from the example. Including parentheses<code>(</code> and <code>)</code>.</p>
  
  <p>In attempting to solve this, I've writtent the following code.</p>
  
  <pre><code>string testString = @"(mail)|(time)";  
  
  Regex regx = new Regex(Regex.Escape(testString), RegexOptions.IgnoreCase);
  List&lt;string&gt; mactches = regx.Matches(inputString).OfType&lt;Match&gt;().Select(m =&gt; m.Value).Distinct().ToList();
  
  foreach (string match in mactches)
  {
      //Do something
  }
  </code></pre>
  
  <p>Is the pipe(<code>|</code>) used for the logical <code>OR</code> condition?</p>