title: Linq Regex for whole word search
body: <p>I'm unable to find a recent decent answer on this.</p>
  
  <p>Linq does not support regex, and trying to extract a method out does not outsmart the framwork. How do I do a whole work match on a list of sentences in linq.</p>
  
  <p>The reason I need the \b is because it could be start or end of string, or have a comma, dash, or other similar separators.</p>
  
  <pre><code>    private bool isMatch(string searchText, string text)
      {
          return Regex.IsMatch(searchText, "\\b"+text+"\\b", RegexOptions.IgnoreCase | RegexOptions.Compiled);
      }
  
  
          result  p = itemsRep
              .Where(fullText=&gt; isMatch(searchText, fullText))
              .FirstOrDefault();
  </code></pre>