I'm struggling to come up right regex to solve my problem. I need to parse the variables and their values out of this Sass file. Variables always start with $ and end with :, and their values begin after the : and end with ;, much like CSS.
I'm using .Net's regex parser, and testing against this useful regex tool: http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx
I'm able to find the variables just fine with this match string
\$[\w\d-]*:
However, how can I find the matching value pair and not pick up the false positives from the other css, such as "10px"
/*
Theme Name: Huff
*/
// Particle Imports
@import "blueprint";
// Blueprint Variables
$blueprint_grid_margin: 10px;
// Site Specific Styles
$primary-color: #a1bfc2;
$link-color: #AFBDD2;
html {
font-smooth: always;
}
body.bp {
@include ui;
overflow-x: hidden;
background-color: $secondary-color;
}