lib/regexp-string-mapper.js
function RegExpStringMapper(options) {
	if (!(this instanceof RegExpStringMapper)) {
		return new RegExpStringMapper(options);
	}
	options = options || {};
	this._formatters = [];
	this.addFormatter(createDefaultFormatter(options.serialize || getSerializeFn()));
	this.addFormatter(createMomentFormatter(options.moment));
	this._separator  = options.separator || '%';
	this._regex      = buildDefaultRegex(this._separator);
	this._magic      = '@RegExpStringMapper';
	this._separatorRegExp = RegExp(this._separator + this._separator, 'g');
	this._magicRegExp = RegExp(this._magic, 'g');
}
function RegExpStringMapper(options) {
	if (!(this instanceof RegExpStringMapper)) {
		return new RegExpStringMapper(options);
	}
	options = options || {};
	this._formatters = [];
	this.addFormatter(createDefaultFormatter(options.serialize || getSerializeFn()));
	this.addFormatter(createMomentFormatter(options.moment));
	this._separator  = options.separator || '%';
	this._regex      = buildDefaultRegex(this._separator);
	this._magic      = '@RegExpStringMapper';
	this._separatorRegExp = RegExp(this._separator + this._separator, 'g');
	this._magicRegExp = RegExp(this._magic, 'g');
}
function RegExpStringMapper ( options ) { if ( ! ( this instanceof RegExpStringMapper ) ) { return new RegExpStringMapper ( options ) ; } options = options || { } ; this . _formatters = [ ] ; this . addFormatter ( createDefaultFormatter ( options . serialize || getSerializeFn ( ) ) ) ; this . addFormatter ( createMomentFormatter ( options . moment ) ) ; this . _separator = options . separator || '%' ; this . _regex = buildDefaultRegex ( this . _separator ) ; this . _magic = '@RegExpStringMapper' ; this . _separatorRegExp = RegExp ( this . _separator + this . _separator , 'g' ) ; this . _magicRegExp = RegExp ( this . _magic , 'g' ) ; }
RegExp string mapper

@param {Object} options Options
@param {[String]} options.separator Token match separator, default - %
@param {[Formatter[]]} options.formatters Array of formatters
RegExp string mapper