Created
September 2, 2014 14:49
-
-
Save strebl/252a8f91d7603bf7f89b to your computer and use it in GitHub Desktop.
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
$(function() { | |
var text = $("#code textarea").text(); | |
var patt = new RegExp(/(.+?): ?(.+?);/gi); | |
var matches = []; | |
while (match = patt.exec(text)) { | |
console.log(match); | |
matches.push({ key: match[1], value: match[2] }); | |
} | |
$("#output").text(""); | |
$(matches).each(function(index, css) { | |
console.log(css); | |
$("#output").append(css.key + " " + css.value + "<br>"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment