I have a string in this form:
url(\"http://www.example.com/imgs/backgrounds/bg80.jpg\") repeat scroll 10% 0% transparent
This is from a CSS sty
Just capture anything between ( and )
(
)
var url = str.match(/\((.*?)\)/)[1].replace(/('|")/g,''); var image = new Image(); image.src = url;
FIDDLE