title: How to use .replace() to replace parts of a string containing a bitwise operator
body: <p>I know you can use str.replace(/something/g, "something else") to replace all occurrences of a specific string. But if that string contains a bitwise operator, the code no longer works. It interprets ^ as an xor operator, so how do you work around this? How do you specify to look for the <em>string</em> ^, and not the <em>operator</em> ^?</p>
  
  <pre><code>var str = "3^3^3";
  var newStr = str.replace(/^/g, "**"); //returns "**3^3^3"
  console.log(eval(newStr)); //returns error
  </code></pre>
  
  <p>desired result: </p>
  
  <pre><code>var str = "3^3^3";
  var newStr = something... // "3**3**3"
  console.log(eval(newStr)); // 762597484987
  </code></pre>