title: javascript Invalid regular expression with token '\'
body: <p>i created the following regex for finding a url matching a word in the complete path and that does't contain the point character.</p>
  
  <pre><code>(\path\?*)([^.]*)$
  </code></pre>
  
  <p>It works on <a href="https://www.regex101.com/#javascript" rel="nofollow">https://www.regex101.com/#javascript</a>, but on grunt in the connect task when i define this connect task:</p>
  
  <pre><code>middleware: function(connect, options) {
   var middlewares = [];
  
   middlewares.push(modRewrite(["(\path\?*)([^.]*)$ /home.html [L]"])); 
      options.base.forEach(function(base) {
        middlewares.push(connect.static(base));
      });
      return middlewares;
    }
  </code></pre>
  
  <p>i got this error: <code>Invalid regular expression: /(home?*)([^.]*)$/: Nothing to repeat</code> and the IDE warn me in the two slash (\path\ ) between the 'path ' word.</p>
  
  <p>Why i can use those slashes?
  What can i use to replace those slashes?
  Thanks very much  </p>