Skip to content

Instantly share code, notes, and snippets.

@cetver
Created August 6, 2014 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cetver/02c90c9b8bac856b92ed to your computer and use it in GitHub Desktop.
Save cetver/02c90c9b8bac856b92ed to your computer and use it in GitHub Desktop.
var template =
'<div class="row">' +
'<div class="col-xs-2 col-sm-1 align-right">' +
'<span class="{ icon_class }"></span>' +
'</div>' +
'<div class="col-xs-7 col-sm-9">' +
'<p>{message}</p>' +
'<time datetime=""><{when_created}</time>' +
'</div>' +
'<div class="col-xs-3 col-sm-2 align-right-fxd">' +
'<img src="{image_url}" alt="">' +
'</div>'
;
var vars = template.match(/\{(.*?)\}/g).map(function(val){
return $.trim(val.replace(/[\{|\}]/g,''));
});
console.log(vars);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment