code: function createUnitRegex(units) {
      return Object.keys(units)
          .sort((a, b) => b.length - a.length)
          .map(unit => unit.length > 2 ? caseInsensitivePart(unit) : unit)
          .join('|');
  }
docs: Create a regex for the given associative object.