Jeśli tekst jest w kręconych klamrach, zamień na stronie Div: Stackoverflow.com

function getParams(input){
  var matches = [];
  input.replace(/(\{+)([^}]+)(}+)/g,function(orig,lb,txt,rb){
      if (lb.length === rb.length)
        matches.push(txt);
  });
  return matches;
}
var string = "<div>{{foo}} and {{{bar}}} and {{{{hahahaahahahahahaha}}}}</div>";
document.write(getParams(string));
Lonely Lynx