code: function patternFor(self, basename) {
    if (!has(self.__patterns__, basename)) {
      var pattern;
  
      var extname = path.extname(basename);
  
      if (has(self.__aliases__, extname) && self.__aliases__[extname].length) {
        basename = path.basename(basename, extname);
        pattern  = escapeRegexp(basename) +
          '(?:' + [ extname ].concat(self.__aliases__[extname]).map(escapeRegexp).join('|') + ')';
      } else {
        pattern  = escapeRegexp(basename);
      }
  
      pattern += '(?:' + self.__extensions__.map(escapeRegexp).join('|') + ')*';
      self.__patterns__[basename] = new RegExp('^' + pattern + '$');
    }
  
    return self.__patterns__[basename];
  }
docs: Returns a `Regexp` that matches the allowed extensions.  patternFor(self, "index.html"); // => /^index(?:.html|.htm)(?:.builder|.erb)*$/