Last active
December 23, 2015 16:39
-
-
Save simondell/6663926 to your computer and use it in GitHub Desktop.
Regex to get parts of an image URL out of the string returned from elem.style.backgroundImage.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// finds an image path in the string returned from elem.style.backgroundImage | |
var = rgx = /(?:url\(['"]?)(\w[a-z-.\/]+)(?:['"]?\))/g; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment