title: Regex: Negative lookahead with capturing group not from beginning
body: <p>I have achieved a regular expression in Javascript which can match a navigator.userAgent string from Safari and not from iPad:</p>
  
  <pre><code>/^(?!.*Mobile).*Safari/i
  </code></pre>
  
  <p>My problem is that when doing the match this returns the whole string:</p>
  
  <pre><code>var pattern = /^(?!.*Mobile).*Safari/i;
  
  var pc = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2";
  
  var ipad = "Mozilla/5.0 (iPad; CPU OS 6_1_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B146 Safari/8536.25";
  
  ipad.match(pattern); // Returns null
  pc.match(pattern);   // Returns ["Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari"]
  </code></pre>
  
  <p>What I want in the last line is to return only:</p>
  
  <pre><code>["Safari"]
  </code></pre>
  
  <p>I've made some research and I know you can remove the capturing group nature from a regex by doing (?:term) or (?is:term), but it doesn't even compile with negative lookahead (at least in Safari). I tried also capturing with brackets the "Safari" at the end of the match, but it returns a second element inside the array.</p>
  
  <p>Does anyone know how can I accomplish this within an only regular expression?</p>
  
  <p>Thanks in advance.</p>