I need to replace relative url in my css files into my servers static URL.

For example, I have a CSS rule:

[/public/images...] or ['/public/images...'], or [../public/images...] or ['../public/images...'] and I need to replace all of these urls into my static server CDN:

```
/public/images... -> //static.mysite.com/public/images...
'/public/images...' -> '//static.mysite.com/public/images...'
../public/images... -> //static.mysite.com/public/images...

```

I wrote a regular expression to do this, but it doesn't work with '../' at the beginning of the URL. Here it is:

```
$fileRawContent = file_get_contents($filePath);
$replacedContent = preg_replace('/\(\'?(.*(\.\.)?\/public\/images.*)\'?\)/', "($staticServer$1)", $fileRawContent);

```

This works only for /public/images but not for ../public/images...

Please advice how to do like I said.
Thank you!