I have string that looks like :
"test-file" : "abc.xml","test2-file":"abcd.xml","test3-file":"bcde.xml","test-file" : "def.xml"'
How can I create a regex that outputs an array like :
{abc.xml, def.xml} or {"test-file" : "abc.xml","test-file" : "def.xml"}
that is only pairs with test-file before ':'
.
I tried :
json.match(/"test-file" : "(.*)\.xml"/);
but I am getting output:
0: "\"test-file\" : \"abc.xml\",\"test2-file\":\"abcd.xml\",\"test3-file\":\"bcde.xml\",\"test-file\" : \"def.xml\""
1: "abc.xml\",\"test2-file\":\"abcd.xml\",\"test3-file\":\"bcde.xml\",\"test-file\" : \"def"