title: preg_replace only replaces first occurrence then skips to next line
body: <p>Got a problem where preg_replace only replaces the first match it finds then jumps to the next line and skips the remaining parts on the same line that I also want to be replaced.</p>
  
  <p>What I do is that I read a CSS file that sometimes have multiple "url(media/pic.gif)" on a row and replace "media/pic.gif" (the file is then saved as a copy with the replaced parts). The content of the CSS file is put into the variable $resource_content:</p>
  
  <pre><code>$resource_content = preg_replace('#(url\((\'|")?)(.*)((\'|")?\))#i', '${1}'.url::base(FALSE).'${3}'.'${4}', $resource_content);
  </code></pre>
  
  <p>Does anyone know a solution for why it only replaces the first match per line?</p>