Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 410 Bytes

.verb.md

File metadata and controls

23 lines (18 loc) · 410 Bytes

Usage

The main export of this module is a function that must be called:

var regex = require('{%= name %}');
console.log(regex());

Example

function interpolate(str, data) {
  return str.replace(re(), function(m, prop) {
    return data[prop] || prop;
  });
}

var str = 'foo ${bar} baz ${quux}';
var data = {bar: 'AAA', quux: 'BBB'};
interpolate(str, data);
//=> 'foo AAA baz BBB'