What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-08-31 22:39:02
if text is in curly braces replace to div site: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 {{... Add solution