Skip to content

Instantly share code, notes, and snippets.

@ryedin
Created August 23, 2013 17:44
Show Gist options
  • Save ryedin/6322001 to your computer and use it in GitHub Desktop.
Save ryedin/6322001 to your computer and use it in GitHub Desktop.
squares and curlies
var tmplExpressions = [
{
expression: /\[\[([^\]]*)\]\]/g,
replace: "{{$1}}"
},
{
expression: /\$\[([^\]]*)\]/g,
replace: "${$1}"
}
];
_.each(tmplExpressions, function(expr) {
str = str.replace(expr.expression, expr.replace);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment