code: function getNumberingRanges(str) {
      return findUnescapedTokens(str || '', numberingToken)
      .reduce((out, range) => {
          // skip ranges that actually belongs to output placeholder or tabstops
          if (!/[#{]/.test(str[range[0] + 1] || '')) {
              const lastRange = out[out.length - 1];
              if (lastRange && lastRange[0] + lastRange[1] === range[0]) {
                  lastRange[1] += range[1];
              } else {
                  out.push(range);
              }
          }
  
          return out;
      }, []);
  }
docs: Returns numbering ranges, e.g. ranges of `$` occurances, in given string.
  Multiple adjacent ranges are combined
  @param  {String} str
  @return {Array}