title: Need count of exact matching string in a text file for a groovy script
body: <p>I am trying to get a count of exact matching string in a file called file.txt for a groovy script.
  so suppose my file is :-</p>
  
  <pre><code>phone
  phone
  phone
  iphone
  phone
  iphone
  </code></pre>
  
  <p>Now when i run :-</p>
  
  <pre><code>grep -c "phone" file.txt
  </code></pre>
  
  <p>i get the count as 6 and not 4 since iphone also contains the string phone. In shell i can get the exact only string using :-</p>
  
  <pre><code>grep -c '\bphone' file.txt
  </code></pre>
  
  <p>But that doesn't work in groovy shell. How to get that working?</p>