I'm working on a regexp to find and replace all matches that don't start with url(http
relative paths are going to be converted to full absolut paths ie: url(foo/bar) > url('http://foo/bar')
match:
- url(foo/bar)
- url('foo/bar')
don't match:
- url(http://foo/bar)
- url('http://foo/bar')
This is what I've come up with so far, but I'm not 100% there
$fileContents = preg_replace(
'/url\(("|\')?(?<!(http))(.+?)("|\')?\)/i',
'url(\'' . $glmBaseUrl . $subDir . '/$3\')',
$fileContents
);