Here is my regex code:
preg_match_all('/background[-image]*:[\s]*url\(["|\']+(.*)["|\']+\)/', $css, $matches, PREG_SET_ORDER);
He is looking for CSS that looks like this:
background:url('../blah.jpg');
My problem I am facing is the CSS that I scratch looks like this:
background:transparent url('../blah.jpg'); background:transparent no-repeat url('../blah.jpg');
I'm not an expert when it comes to regex, so I wonder how I can say that it skips something after the colon and before the URL.
source share