1var re = /\s*([^[:]+):\"([^"]+)"/g;
2var s = '[description:"aoeu" uuid:"123sth"]';
3var m;
4
5do {
6 m = re.exec(s);
7 if (m) {
8 console.log(m[1], m[2]);
9 }
10} while (m);
11
1let array = [...str.matchAll(regexp)];
2
3array[0];
4// ['test1', 'e', 'st1', '1', index: 0, input: 'test1test2', length: 4]
5array[1];
6// ['test2', 'e', 'st2', '2', index: 5, input: 'test1test2', length: 4]
7