Programming Tips - javaScript: How can I extract using /g in a regular expression in javaScript?

Date: 2016apr18 Language: javaScript Keywords: regex Q. javaScript: How can I extract using /g in a regular expression in javaScript? A. Here is an example:
const re = /\{([^}]*)\}/g; // {stuff}{stuff}{stuff}... const a; while ((a = re.exec(value)) !== null) { const includingBrace = a[0]; // One full match const insideBrace = a[1]; // Characters inside the round brackets }
String.match() doesn't work