title: regex look-behind: Invalid regular expression: /(?<=\.)\S+$/: Invalid group
body: <p>I have the following regexp</p>
  
  <pre><code>(?&lt;=\.)\S+$
  </code></pre>
  
  <p>used to extract the extension (whatever comes after the last dot) of a string. <a href="https://regex101.com/r/aV8sY8/1" rel="nofollow"><strong>regex101.com</strong></a> seems to accept my regexp: the string extension is correctly matched. As soon as I move it into a javascript script and try to test it against a string I get this error:</p>
  
  <pre><code>Invalid regular expression: /(?&lt;=\.)\S+$/: Invalid group
  </code></pre>
  
  <p>I get the same error also with regex101 auto generated code:</p>
  
  <pre><code>var re = /(?&lt;=\.)\S+$/; 
  var str = 'test.txt';
  var m;
  
  if ((m = re.exec(str)) !== null) {
      if (m.index === re.lastIndex) {
          re.lastIndex++;
      }
      // View your result using the m-variable.
      // eg m[0] etc.
  }
  </code></pre>
  
  <p>see fiddle <a href="https://jsfiddle.net/m959scy6/" rel="nofollow"><strong>HERE</strong></a></p>
  
  <p>Any hint? </p>