I\'m trying to parse the following kind of string:
[key:\"val\" key2:\"val2\"]
where there are arbitrary key:\"val\" pairs inside. I want t
To loop through all matches, you can use the replace function:
replace
var re = /\s*([^[:]+):\"([^"]+)"/g; var s = '[description:"aoeu" uuid:"123sth"]'; s.replace(re, function(match, g1, g2) { console.log(g1, g2); });