Is there a way to replicate this PHP snippet in JQuery or Javascript...
You can get all blocks of text between { and } into an array with this:
function getBracedText(input) {
var re = /\{(.*?)\}/g, matches, output = [];
while (matches = re.exec(input)) {
output.push(matches[1]);
}
return(output);
}
var str = "Some text {tag} and more {text}";
var results = getBracedText(str);
// results == ["tag", "text"];
Working demo: http://jsfiddle.net/jfriend00/DT4Km/