title: Regex to match everything except the given words (which may include hyphens/dashes)
body: <p>I would like to match everything except the given word(s), so given this list:</p>
  
  <pre><code>wordOne
  wordTwo/xy/z
  word-three
  word-four/lots/of/stuff
  </code></pre>
  
  <p>I could use this regexp to match everything except wordOne:</p>
  
  <pre><code>(?!wordOne)\b.+
    ==&gt;
      wordTwo/xy/z
      word-three
      word-four/lots/of/stuff   
  </code></pre>
  
  <p>However if I want to match everything <strong>except one of the words containing a hyphen/dash</strong>, the same regexp does not work, because the hyphen is not a part of the word boundary - which is [a-zA-Z0-9_]</p>
  
  <p>E.g</p>
  
  <pre><code>some-regexp(word-four)
    ==&gt;
      wordOne
      wordTwo/xy/z
      word-three
  </code></pre>
  
  <p>And</p>
  
  <pre><code>some-regexp(word-four and word-three)
    ==&gt;
      wordOne
      wordTwo/xy/z
  </code></pre>