lib/remix.js
function ReMix(name) {
    var args = _.flatten(_.toArray(arguments));
    if (_.isString(name) || _.isNull(name) || _.isUndefined(name))
      args = args.slice(1);
    else
      name = undefined;
    /**
     * Unique id used for storing data in RegExp objects
     * @private
     */
    this._id           = genguid();
    /**
     * Current instance options
     * @private
     */
    this._opt          = {};
    /**
     * Stores current unresolved specification
     * @private
     */
    this._specs        = [];
    /**
     * Tracking data for relating namespace to match index
     * @private
     */
    this._matches      = [];
    /**
     * This ReMix's name
     * @private
     */
    this._name         = name;
    /**
     * Used when composing ReMix objects or named RegExp objects. {@link module:lib/remix#scope}
     * @private
     */
    this._namestack    = [];
    /**
     * Used to track position when executing regular expression
     * @private
     */
    this._lastIndex     = 0;
    if (name)
      this._namestack.push(name);
    this.options(ReMix.defaultOptions);
    if (args.length)
      this.add(args);
  }
function ReMix(name) {
    var args = _.flatten(_.toArray(arguments));
    if (_.isString(name) || _.isNull(name) || _.isUndefined(name))
      args = args.slice(1);
    else
      name = undefined;
    /**
     * Unique id used for storing data in RegExp objects
     * @private
     */
    this._id           = genguid();
    /**
     * Current instance options
     * @private
     */
    this._opt          = {};
    /**
     * Stores current unresolved specification
     * @private
     */
    this._specs        = [];
    /**
     * Tracking data for relating namespace to match index
     * @private
     */
    this._matches      = [];
    /**
     * This ReMix's name
     * @private
     */
    this._name         = name;
    /**
     * Used when composing ReMix objects or named RegExp objects. {@link module:lib/remix#scope}
     * @private
     */
    this._namestack    = [];
    /**
     * Used to track position when executing regular expression
     * @private
     */
    this._lastIndex     = 0;
    if (name)
      this._namestack.push(name);
    this.options(ReMix.defaultOptions);
    if (args.length)
      this.add(args);
  }
function ReMix ( name ) { var args = _ . flatten ( _ . toArray ( arguments ) ) ; if ( _ . isString ( name ) || _ . isNull ( name ) || _ . isUndefined ( name ) ) args = args . slice ( 1 ) ; else name = undefined ; /**
     * Unique id used for storing data in RegExp objects
     * @private
     */ this . _id = genguid ( ) ; /**
     * Current instance options
     * @private
     */ this . _opt = { } ; /**
     * Stores current unresolved specification
     * @private
     */ this . _specs = [ ] ; /**
     * Tracking data for relating namespace to match index
     * @private
     */ this . _matches = [ ] ; /**
     * This ReMix's name
     * @private
     */ this . _name = name ; /**
     * Used when composing ReMix objects or named RegExp objects. {@link module:lib/remix#scope}
     * @private
     */ this . _namestack = [ ] ; /**
     * Used to track position when executing regular expression
     * @private
     */ this . _lastIndex = 0 ; if ( name ) this . _namestack . push ( name ) ; this . options ( ReMix . defaultOptions ) ; if ( args . length ) this . add ( args ) ; }
Construct a new `ReMix` object.

The name sets this ReMix's name. The name is used when
returning matches. All sub-child matches are namespaced based
on the hierarchy of names. `name` is optional.

Any arguments after `name` are passed to {@link ReMix#add}.
@constructor
@alias ReMix
@public
@param {ReMix~Name} [name] - The name for this ReMix object.
@param {ReMix~Spec} spec - Specification for this ReMix object.
@example
var a1 = new ReMix('a1'),
a2 = new ReMix('a2'),
str = "foobar";

a1.options({nsDelimiter: '/'});
a1.add({foo: /foo/});
a2.add({bar: /bar/});

a1.add(a2);

console.log(a1.exec(str)); // [['foo'], 'a1/foo',    0, 3]
console.log(a1.exec(str)); // [['foo'], 'a1/a2/bar', 1, 6]
Construct a new ReMix object .