I obtain some CSS and store it in a var, but i am trying to use regexes to parse classes. Thats the easy part, but it seems that i have issues with the regex to scrape contents between the braces to store.
My attempt is at: http://jsfiddle.net/2qaCY/
All i want is to iteratively loop through the classes and scrape the contents between the braces.
code on fiddle:
var css = ".Winning{color: #24CCFF;background-color: #FF8091;}.Losing{color: #2EFFCE;background-color: #DB4DFF;}.crayons{font-family: papyrus;font-size: 32pt;}";
var reg = /\.[a-zA-Z0-9]*\{/ig;
var matches = css.match(reg);
for (var m in matches) {
var sClass = matches[m].substr(0, matches[m].length - 1);
$("body").append(sClass + "<br />");
var c = new RegExp("\\." + sClass + "[\\n\\s]*\{[\\s\\n.]*\}", "ig");
var out = c.exec(css);
$("body").append(out);
$("body").append("<br /><br />");
}