I have a comment block that can look like this;
/**
* variable1: value
* variable2: value
*/
or like this;
/*
variable1: value
variable2: value
*/
What I need is to be able to match any number of variable/value pairs and add them to an array. I can't seem to figure it out though, I keep matching the wrong things.
All variables would be single-line, so that should simplify things a little. Spaces before 'variable' or after the the colon should be disregarded, but any other spaces in the value lines should be retained.
UPDATE:
What I ended up going with was a slight expansion of the selected answer;
/(\w)*\s*:\s*([\w'"\/.: ]*)/
It allowed for URLs to be used as values like so;
/**
* url: 'some/file.png'
* url: "http://www.google.ca/intl/en_ca/images/logo.gif"
*/