title: Javascript invalid regular expresion error in NW.js
body: <p>I have a regular expression which I need to test with a string, it works when I test it online </p>
  
  <pre><code>^(?![.])^[.a-zA-Z0-9]*(?&lt;!\.)$
  </code></pre>
  
  <p>You can test it : <a href="https://regex101.com/r/bomm5g/1/" rel="nofollow noreferrer">https://regex101.com/r/bomm5g/1/</a></p>
  
  <p>But when I write a code for it, I get this error</p>
  
  <pre><code>Invalid regular expression: /^(?![.])^[.a-zA-Z0-9]*(?&lt;!.)$/: Invalid group
  </code></pre>
  
  <p>The code is as below</p>
  
  <pre><code>var regex = new RegExp("^(?![.])^[.a-zA-Z0-9]*(?&lt;!\.)$");
  regex.test(inputvalue);
  </code></pre>
  
  <p>How can I get this to work ?</p>