title: Regex : How to avoid matching a word in a string upon a condition
body: <p>I have a problem with excluding some special condition. I already create example in this <a href="http://regexr.com/3f17i" rel="nofollow noreferrer">LINK</a>.</p>
  <p>If I have List of Sentence like this :</p>
  <pre><code>X-MAS TREE //it should be excluded because match my dictionary
  BLA BLA TREE
  XMAS TREE
  X-MASTREE
  X-TREE
  X-MASTREE
  </code></pre>
  <p>And I have Dictionary that <strong>X-MAS TREE</strong> has synonyms: <strong>XMAS TREE, X-MASTREE, X-TREE, TREE</strong>.  And I need to change all the synonyms word into my Dictionary Word.</p>
  <p>How to exclude <strong>X-MAS TREE</strong>?
  Because all of those regex, will be replace with <strong>X-MAS TREE</strong>
  If I search with keyword <strong>TREE</strong>, it will be infinite loop, because <strong>X-MAS TREE</strong> has <strong>TREE</strong></p>
  <p>I already tried many combination, but is not working:</p>
  <pre><code>\b(XMAS TREE|X\-MASTREE|X\-TREE|TREE|(?!X\-MAS TREE)\b
  \b(XMAS TREE|X\-MASTREE|X\-TREE|(?!X\-MAS \s)TREE)\b
  \b(XMAS TREE|X\-MASTREE|X\-TREE|((?!X\-MAS )|\w*)TREE)\b
  \b(XMAS TREE|X\-MASTREE|X\-TREE|(?:(?!X\-MAS) )TREE)\b
  </code></pre>
  <p><strong>EDIT</strong></p>
  <p>I need to use Boundaries (for some reason), because I create the regex in my code, with looping, and need to use it for another Dictionary, that why, for this case, I need special condition (without change the structure code, only edit the regex <strong>TREE</strong>)</p>