title: Replacing using regex in a string javascript
body: <p>I am trying to replace a particular string using regex.</p>
  
  <pre><code>var replace = {'&amp;lt;RAndom&amp;gt;': "random object"};
  </code></pre>
  
  <p>I am replacing it using the dynamic regex because i have a lot of objects.</p>
  
  <pre><code>var tagsText = "&amp;lt;RAndom&amp;gt; hellow world";
  var regex = new RegExp('\\b(' + Object.keys(replace).join('|') + ')\\b', 'g');
  tagsText = tagsText.replace(regex, function(match) {
      return replace[match] + match;
  });
  </code></pre>
  
  <p>But it is not working.I think the problem is with the semicolon but i am not sure.The output is again the same.</p>
  
  <pre><code>"&amp;lt;RAndom&amp;gt; hellow world"
  </code></pre>
  
  <p>Any ideas?</p>