title: RegEx to extract URL from CSS background styling
body: <p>I have a string in this form:</p>
  
  <pre><code>url("http://www.example.com/imgs/backgrounds/bg80.jpg") repeat scroll 10% 0% transparent
  </code></pre>
  
  <p>This is from a CSS styling  for a certain element that at the moment isn't visible on the page. What I need to do is preload that background image, but to do this I need it's URL, and I'm trying to write a regular expression find it.</p>
  
  <p>I know the <code>http://www.example.com/imgs/backgrounds/</code> part remains constant, the only thing changing is the image name itself, which can end with either <code>.jpg</code> or <code>.png</code>.</p>
  
  <p>This was one attempt:</p>
  
  <pre><code>(http:\/\/www.example.com\/imgs\/backgrounds\/)[\w\.\-]*
  </code></pre>
  
  <p>The problem with this being that only the <code>http://www.example.com/imgs/backgrounds/</code> part was being picked up. So I tried this, but this doesn't work at all!</p>
  
  <pre><code>(http:\/\/www.example.com\/imgs\/backgrounds\/)[\w\.\-]*(.jpg|.png)
  </code></pre>
  
  <p>What am I doing wrong?
  Thank you for any help!</p>