title: javascript string replace SyntaxError: Unexpected token .
body: <p>Can someone please tell me why this doesn't work?</p>
  
  <pre><code>str = "program";
  destdriver = str.replace(/(internal|file|program)/), "$1");
  console.log(destdriver);
  </code></pre>
  
  <p>I get:
  Uncaught SyntaxError: Unexpected token . </p>