title: Java Pattern to match any sequence of characters except a given list
body: <p>How do I write a Pattern (Java) to match any sequence of characters except a given list of words?</p>
  
  <p>I need to find if a given code has any text surrounded by tags like  besides a given list of words.
  For example, I want to check if there are any other words besides "one" and "two" surrounded by the tag .</p>
  
  <pre><code>"This is the first tag &lt;span&gt;one&lt;/span&gt; and this is the third &lt;span&gt;three&lt;/span&gt;"
  </code></pre>
  
  <p>The pattern should match the above string because the word "three" is surrounded by the tag  and is not part of the list of given words ("one", "two").</p>