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
Programming Tips - How can I extract using /g in a regular expression in javaScript?
Date: 2016apr18
Language: javaScript
Q. How can I extract using /g in a regular expression in javaScript?
A. Here is an example: