JSFiddle - React, Tailwind, and code Playground
JavaScript
var curly = new RegExp("{([a-z0-9]+)}", "gi");
var stringTest = "This is a {test} of my {pattern}";
var matched = curly.exec(stringTest);
console.log(matched);
var curly = new RegExp("{([a-z0-9]+)}", "gi");
var stringTest = "This is a {test} of my {pattern}";
var matched = curly.exec(stringTest);
console.log(matched);