Skip to content

Instantly share code, notes, and snippets.

@gtzilla
Created July 21, 2011 01:06
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 gtzilla/1096293 to your computer and use it in GitHub Desktop.
Save gtzilla/1096293 to your computer and use it in GitHub Desktop.
// utility string parse function
function out( str, options ) {
for(k in options) {
str=str.replace(/%\{([a-zA-Z0-9-]{1,}?)\}/mi, function(m, key ){
return options[key];
});
}
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment