title: How to only replace exact word in text using regex c#
body: <p>I am currently using this code to replace exact match. However this does not work, it also removed where the words appear in other words.</p>
  
  <p>Example:</p>
  
  <pre><code>string pattern = "(?i)(flo)";
  jobTitle = Regex.Replace("Florist of Vinyl Flowers of flo abc", pattern, string.Empty);
  </code></pre>
  
  <p>This is making the string :</p>
  
  <blockquote>
    <p>orist of Vinyl owers</p>
  </blockquote>
  
  <p>Which is wrong it should only remove flo from the string, and if I use :</p>
  
  <pre><code>string pattern = "(?i)\b(flo)\b";
  </code></pre>
  
  <p>It does not match however even if there is a complete word in there it wont match, nothing matches/</p>
  
  <p>UPDATE :</p>
  
  <p>The complete code runs like this:</p>
  
  <pre><code>splitter = wordToremoveTitle.Split('|');
  if (splitter.Length &gt; 0)
   {
  
    for (int t = 0; t &lt; splitter.Length ; t++)
    {
    String pattern = @"(?i)\b(" + splitter[t] + ")\b";
    jobTitle = Regex.Replace(jobTitle, pattern, string.Empty);
    }
  </code></pre>