title: Invalid Regular Expression: missing / Error in Chrome
body: <p>I'm using jQuery to search for a specific string using a regex and then replace that string with some html code. See below</p>
  
  <pre><code>var mobile = /0330 3030 036/g;
  var landline = /0800 953 0304/g;
  
  var newLandLine = $("body").html().replace(mobile, '&lt;span class="calltracks_lcplccouk-current-mobile-landing-page03"&gt;CORRECT&lt;/span&gt;');
  
  newLandLine = newLandLine.replace(landline, '&lt;span class="calltracks_lcplccouk-lcplccoukcurrentmobilelandingpage08"&gt;CORRECT 2&lt;/span&gt;');
  
  $("body").html(newLandLine);
  </code></pre>
  
  <p>This works fine on the surface but when I view the Chrome console I am presented with the error message:</p>
  
  <pre><code>Uncaught SyntaxError: Invalid regular expression: missing /
  </code></pre>
  
  <p>Does anyone have any suggestions on how to reslove this so that the code still functions but the error is no longer displayed?</p>
  
  <p>The HTML I'm using is very basic:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head&gt;
      &lt;title&gt;Test Page&lt;/title&gt;
      &lt;script src="./test2_files/jquery.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;h1&gt;This is a test&lt;/h1&gt;
      &lt;p&gt;0330 3030 036&lt;/p&gt;
      &lt;p&gt;0800 953 0304&lt;/p&gt;
      &lt;script&gt;
      $(document).ready(function() {
          if (document.cookie.indexOf("l&amp;c-original") &gt;= 0) {} else {
              var mobile = /0330 3030 036/g;
              var landline = /0800 953 0304/g;
              var newLandLine = $("body").html().replace(mobile, '&lt;span class="calltracks_lcplccouk-current-mobile-landing-page03"&gt;CORRECT&lt;/span&gt;');
              newLandLine = newLandLine.replace(landline, '&lt;span class="calltracks_lcplccouk-lcplccoukcurrentmobilelandingpage08"&gt;CORRECT 2&lt;/span&gt;');
              $("body").html(newLandLine);
          }
      });
      &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Many thanks</p>