title: JavaScript regex test if string contains specific word (with variable)
body: <p>I have a regex to check if a string contains a specific word. It works as expected:</p>
  
  <pre><code>/\bword\b/.test('a long text with the desired word amongst others'); // true
  /\bamong\b/.test('a long text with the desired word amongst others'); // false
  </code></pre>
  
  <p>But i need the word which is about to be checked in a variable. Using <code>new RegExp</code> does not work properly, it always returns <code>false</code>:</p>
  
  <pre><code>var myString = 'a long text with the desired word amongst others';
  
  var myWord = 'word';
  new RegExp('\b' + myWord + '\b').test(myString); // false
  
  myWord = "among";
  new RegExp('\b' + myWord + '\b').test(myString); // false
  </code></pre>
  
  <p>What is wrong here?</p>