Created
August 23, 2013 17:44
-
-
Save ryedin/6322001 to your computer and use it in GitHub Desktop.
squares and curlies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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