var i = "[{a:1,b:2}]",_x000D_
j = i.replace(/([a-zA-Z0-9]+?):/g, '"$1":').replace(/'/g,'"'),_x000D_
k = JSON.parse(j);_x000D_
_x000D_
console.log(k)
_x000D_
// => declaring regular expression
[a-zA-Z0-9] => match all a-z, A-Z, 0-9
(): => group all matched elements
$1 => replacement string refers to the first match group in the regex.
g => global flag