I am trying to match keys in JSON of this type:
define({
key1: "some text: and more",
key2 : 'some text ',
key3: ": more some text",
key4: 'some text:'
});
with this regexp (?<=\s|{|,)\s*(\w+)\s*:\s?[\"|\']/g
. But currently it's matching the last text:
also that should be ignore.
An example could be seen here
Could you give me hint how to fix this regex so it matches only keys.