code: function replaceRegex(token, regex, includeParts, minimumMeasure) {
      var parts;
      var result = '';
  
      if(regex.test(token)) {
          parts = regex.exec(token);
  
          includeParts.forEach(function(i) {
              result += parts[i];
          });
      }
  
      if(measure(result) > minimumMeasure) {
          return result;
      }
  
      return null;
  }
docs: TODO: this should replace all of the messy replacement stuff above