Extract the URL from CSS, a better way

Posted on March 8, 2020

I've put a simple way to extract from a CSS code an asset URL here.

I want to update that reference with something better that is able to handle more edge cases.

I've learned a better code here.

So, here a better reg-ex to achieve the same task:

new RegExp(/url\(["']?([^"')]+)["']?\)/gi)