title: c# count a specific word happen times in a txt file
body: <pre><code>    static void Main(string[] args)
      {
          StreamReader oReader;
          if (File.Exists(@"C:\cmd.txt"))
          {
              Console.WriteLine("IMAGE");
              string cSearforSomething = Console.ReadLine().Trim();
              oReader = new StreamReader(@"C:\cmd.txt");
              string cColl = oReader.ReadToEnd();
              string cCriteria = @"\b" + cSearforSomething + @"\b";
              System.Text.RegularExpressions.Regex oRegex = new System.Text.RegularExpressions.Regex(cCriteria, RegexOptions.IgnoreCase);
  
  
  
              int count = oRegex.Matches(cColl).Count;
              Console.WriteLine(count.ToString());
          }
          Console.ReadLine();
      }
  </code></pre>
  
  <p>I cannot calculate the string "IMAGE" happen times in my file? Is my code wrong?</p>