title: C# - Regex Match whole words
body: <p>I need to match all the whole words containing a given a string. </p>
  
  <pre><code>string s = "ABC.MYTESTING
  XYZ.YOUTESTED
  ANY.TESTING";
  
  Regex r = new Regex("(?&lt;TM&gt;[!\..]*TEST.*)", ...);
  MatchCollection mc = r.Matches(s);
  </code></pre>
  
  <p>I need the result to be:</p>
  
  <pre><code>MYTESTING
  YOUTESTED
  TESTING
  </code></pre>
  
  <p>But I get:</p>
  
  <pre><code>TESTING
  TESTED
  .TESTING
  </code></pre>
  
  <p>How do I achieve this with Regular expressions.</p>
  
  <p>Edit: Extended sample string.</p>