I have the following string
server:all, nit:4545, search:dql has map
with the regular expression /(\w+):((?:"[^"]*"|[^:,])*)/g I get
["server:all", "nit:4545", "search:dql has map"] //Array
But I want to get
{server:"all","nit":"4545","search":"dql has map"}
OR
[{server:"all"},{"nit":"4545"},{"search":"dql has map"}]