title: Regex lookahead with multiple negative conditions
body: <p>I am performing a regex on a HTML string to fetch URL's. I want to fetch all href's and src's that are not javascript. From another SO post I have the following pattern:</p>
  
  <pre><code>/(href|src)?\="http:\/\/www\.mydomain\.com\/(?:(?!\.js).)*"/
  </code></pre>
  
  <p>Which fetches me results like:</p>
  
  <pre><code>src="http://www.mydomain.com/path/to/resource/image.gif" alt="" border="0"
  </code></pre>
  
  <p>This is good because it is missing the <code>.js</code> results. It's bad because it's fetching additional tags in the element. I tried the following amendment to stop at the first <code>"</code>:</p>
  
  <pre><code>/(href|src)?\="http:\/\/www\.mydomain\.com\/(?:(?!\.js).)[^"]*"/
  </code></pre>
  
  <p>It works in that it returns href="$url", but it returns results ending in <code>.js</code>. Is there a way to combine a negative lookahead that says:</p>
  
  <ul>
  <li>Match string until it comes across another <code>"</code> - i.e. <code>[^"]*</code>; <strong>and</strong></li>
  <li>Do not match string if it ends in <code>.js"</code></li>
  </ul>
  
  <p>Thanks in advance for any help/tips/pointers.</p>