title: How to grep, excluding some patterns?
body: <p>I'd like find lines in files with an occurrence of some pattern and an absence of some other pattern. For example, I need find all files/lines including <code>loom</code> except ones with <code>gloom</code>. So, I can find <code>loom</code> with command:</p>
  <pre><code>grep -n 'loom' ~/projects/**/trunk/src/**/*.@(h|cpp)
  </code></pre>
  <p>Now, I want to search <code>loom</code> excluding <code>gloom</code>. However, both of following commands failed:</p>
  <pre><code>grep -v 'gloom' -n 'loom' ~/projects/**/trunk/src/**/*.@(h|cpp)
  grep -n 'loom' -v 'gloom' ~/projects/**/trunk/src/**/*.@(h|cpp)
  </code></pre>
  <p>What should I do to achieve my goal?</p>
  <p><em><strong>EDIT 1:</strong></em> I mean that <code>loom</code> and <code>gloom</code> are the character sequences (not necessarily the words). So, I need, for example, <code>bloomberg</code> in the command output and don't need <code>ungloomy</code>.</p>
  <p><em><strong>EDIT 2:</strong></em> There is sample of my expectations.
  Both of following lines are in command output:</p>
  <blockquote>
  <p>I faced the icons that <em>loomed</em> through the veil of incense.</p>
  <p>Arty is <em>slooming</em> in a <em>gloomy</em> day.</p>
  </blockquote>
  <p>Both of following lines aren't in command output:</p>
  <blockquote>
  <p>It’s <em>gloomyin’</em> ower terrible — great muckle doolders o’ cloods.</p>
  <p>In the south west round of the heigh pyntit hall</p>
  </blockquote>