Created
May 31, 2013 08:47
-
-
Save mamboer/5683672 to your computer and use it in GitHub Desktop.
A regex pattern for matching css's inline import url.
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
//Paste the code below into chrome's console and press enter! | |
//Thanks to @alextang https://github.com/ikitty | |
var css = "@import url('file1.css');\r\n"+ | |
"@import url('file2.css');\r\n"+ | |
".test3{\r\n"+ | |
" height: 1px;\r\n"+ | |
"}"; | |
var regexTpl = /@import url\(([^)]*)\);?/gi,match; | |
while((match=regexTpl.exec(css))){ | |
console.log(match); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment