const str = "This is a {string} with {multiple} {words} wrapped in {curly} brackets.";
// Define the RegEx pattern
const regex = /\{([^}]+)\}/g;
// Find all matches
const matches = [];
let match;
while ((match = regex.exec(str)) !== null) {
matches.push(match[1]); // Capture group 1: text inside the brackets
}
console.log("Matches:", matches);
/*
Matches: [ 'string', 'multiple', 'words', 'curly' ]
*/