const str: string = "This is a {string} with {multiple} {words} wrapped in {curly} brackets.";
// Define the RegEx pattern
const regex: RegExp = /\{([^}]+)\}/g;
// Find all matches
const matches: any[] = [];
let match: any;
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"]
*/