This Regex:
$pattern = '/url\(([^)]+)\)/';
matches everything between url( ... ) in CSS files. The problem: If there are quotes, like this: url('...'), they occur in the returned phrase as well.
How to return a phrase without quotes, if there are any?