title: Regex with fswatch - Exclude files not ending with ".txt"
body: <p>For a list of files, I'd like to match the ones not ending with <code>.txt</code>. I am currently using this expression:</p>
  
  <pre><code>.*(txt$)|(html\.txt$)
  </code></pre>
  
  <p><a href="http://regex101.com/r/zA5jR3/1" rel="nofollow">This expression will match everything ending in <code>.txt</code>, but I'd like it to do the opposite.</a></p>
  
  <hr>
  
  <p><strong>Should match:</strong></p>
  
  <pre><code>happiness.html
  joy.png
  fear.src
  </code></pre>
  
  <p><strong>Should</strong> <strong><em>not</em></strong> <strong>match:</strong></p>
  
  <pre><code>madness.html.txt
  excitement.txt
  </code></pre>
  
  <hr>
  
  <p>I'd like to get this so I can use it in pair with <a href="http://emcrisostomo.github.io/fswatch/" rel="nofollow">fswatch</a>:</p>
  
  <pre><code>fswatch -0 -e 'regex here' . | xargs -0 -n 1 -I {} echo "{} has been changed"
  </code></pre>
  
  <p>The problem is it doesn't seem to work.</p>
  
  <p>PS: I use the tag bash instead of fswatch because I don't have enough reputation points to create it. Sorry!</p>